argrafic Posted April 21, 2008 Share Posted April 21, 2008 Hello all. I'm developing the administrator for a website and there is this module where you can upload a file that can be an image or a swf file. I wanted to know if there is a way to get the width and height with PHP of the uploaded file. Thanks! Link to comment https://forums.phpfreaks.com/topic/102176-how-to-get-the-width-and-height-of-uploaded-file/ Share on other sites More sharing options...
dezkit Posted April 21, 2008 Share Posted April 21, 2008 friendly bump Link to comment https://forums.phpfreaks.com/topic/102176-how-to-get-the-width-and-height-of-uploaded-file/#findComment-523053 Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 $imagedim = getimagesize($_FILES['upload_form_name']['tmp_name']; $width = $imagedim[0]; $height = $imagedim[1]; Fill in the appropriate upload form name. This is to get the dimensions BEFORE moving the upload, right? So you can test for size requirements? Link to comment https://forums.phpfreaks.com/topic/102176-how-to-get-the-width-and-height-of-uploaded-file/#findComment-523056 Share on other sites More sharing options...
argrafic Posted April 21, 2008 Author Share Posted April 21, 2008 awesome, thanks a LOT!!!!!!!!! Link to comment https://forums.phpfreaks.com/topic/102176-how-to-get-the-width-and-height-of-uploaded-file/#findComment-523126 Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 awesome, thanks a LOT!!!!!!!!! No problem, dude. It took me a while to figure it out the first time I needed to use it. I wish I had these forums way back when I was beginning, lol. Link to comment https://forums.phpfreaks.com/topic/102176-how-to-get-the-width-and-height-of-uploaded-file/#findComment-523130 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.