3

here is my page

here is my form

<h2>Upload Photo</h2>
<form name="photo" enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
Photo <input type="file" name="image" size="30" /> <input type="submit" name="upload" value="Upload" />
</form>

i have this on top

<?php print_r($_FILES);?>

the script works perfectly locally and when i have it on the server i get nothing....

I have this set

ini_set ('max_execution_time', '86400'); 
set_time_limit(86400); 
ini_set("memory_limit","128M");
ini_set('max_upload_filesize', "30M"); 
ini_set("post_max_size", "150M"); 
ini_set("session.gc_maxlifetime","10800");

echo 'file_uploads: '. ini_get('file_uploads'). '<br />';
echo 'upload_tmp_dir: '. ini_get('upload_tmp_dir'). '<br />';
echo 'upload_max_filesize: '. ini_get('upload_max_filesize'). '<br />';
echo 'max_file_uploads: '. ini_get('max_file_uploads'). '<br />';

I thought it maybe gd but its enabled

GD Support  enabled
GD Version  bundled (2.0.34 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.1.9
T1Lib Support   enabled
GIF Read Support    enabled
GIF Create Support  enabled
JPG Support     enabled
PNG Support     enabled
WBMP Support    enabled
XBM Support     enabled
Matt Elhotiby
  • 43,028
  • 85
  • 218
  • 321
  • 1
    Array ( [image] => Array ( [name] => domain.txt [type] => text/plain [tmp_name] => C:\Temp\UploadData\php1AB0.tmp [error] => 0 [size] => 125 ) ) => it's fine for me. Maybe you try to upload a very large file – Bang Dao Mar 17 '11 at 03:21
  • 1
    Using ini_set() for most of those options is pointless. It's too late to change the acceptable filesize after PHP already started (and copied or ignored it). – mario Mar 17 '11 at 03:25
  • worked perfectly for me.....nice little crop function in there too! you had a couple warnings, but it worked fine. – mpen Mar 17 '11 at 03:37
  • Whats weird is that it shows something in the array when phpinfo is on the page and nothing when its gone....try now....my problem persists – Matt Elhotiby Mar 17 '11 at 03:37
  • maybe your host has disabled file uploads for security reasons? – philfreo Mar 17 '11 at 04:09

2 Answers2

3

Throw a <?php phpinfo(); ?> file on the server and then look in the file_uploads section to make sure it is set to on. I would check phpinfo() too since I have sometimes seen oddities with just checking ini_get()....

Also have you checked with Firebug to make sure that the file is being sent?

Jeremy Conley
  • 924
  • 5
  • 6
  • how do i check with firebug...i have no idea how to check for files being sent – Matt Elhotiby Mar 17 '11 at 03:33
  • It probably is but it is just something extra to check. Install Firebug for Firefox if you need to, then open it, click on the Net tab, refresh the page, submit the form, and then you should see a POST request in there and then click the Post tab in that to see if the file was actually sent... – Jeremy Conley Mar 17 '11 at 03:44
0

I Had the same probleme and i catched by edtiting my .htaccess File because he containe a function that make a rewriting in Url to hide the extension in the Web Page. maybe you have the same probleme. Change the name of .htaccess file to Test it.

Anas
  • 917
  • 7
  • 6