views:

26

answers:

1

I have a few image upload scripts and wordpress blog as well. I think the client tried to upload a 3mb+ images or so and since then everythings stopped working, to further inspection and adding error handlers i found out that

it was UPLOAD TEMP DIR not FOUND

i cant touch the ini file, its shared hosting but i can create a local ini file

i've been told to add php.ini in the public_html folder it only works i.e prints out the upload_tmp_dir when its in the same folder as the script anyway

i put this in the ini file upload_tmp_dir = "/home/USER/tmp" also tried upload_tmp_dir = "/home/USER/public_html/tmp"

but the first one is where the tmp folder was but i tried creating it else where with 777 permissions

leave ini in same folder as the script and calling echo ini_get('upload_tmp_dir');

gives me: [given i set it to that] /home/USER/tmp

sys_get_temp_dir();

gave me /tmp

anyway NOW i get no errors, says file is uploaded but its no where to be found. not sure WTF is going on but clients wrecking my head and so is this.

A: 

PHP will delete uploaded files when the script exits, unless you've moved/copied the file somewhere else yourself. The upload process isn't a "do it now and come back later to deal with it" system. It's "deal with it now, or it's gone".

To retrieve the file's temporary storage location/name, you use $_FILES['namegiveninform']['tmp_name'], and generally would use move_uploaded_file() to move the file into its permanent storage location.

Marc B