File upload issue
Posted by: datinho (---.ip.fastwebnet.it)
Date: February 26, 2007 11:37AM

Hi all,
I've a problem regarding file upload, after the POST action I retrieve the values:

$_FILES['bulk_file']['name'] = bulk_import.csv
$_FILES['bulk_file']['type'] = application/vnd.ms-excel
$_FILES['bulk_file']['size'] = 529
$_FILES['bulk_file']['tmp_name'] = c:/wamp/tmp\php3AE.tmp
$_FILES['bulk_file']['error'] = 0

but in temp dir c:/wamp/tmp there isn't the file php3AE.tmp, there are only session files.

I've checked the php.ini and is correctly configured for file upload, the files that I want upload are less tha 2 Mbyte, and I've assigned for whole c:\wamp the permission of write to everyone (I use wampserver for develop in localhost).

I'm using WAMP version 1.6.6 on windows xp sp2

Regards, Lorenzo



Post Edited (02-26-07 16:38)

Options: ReplyQuote
Re: File upload issue
Posted by: CyberSpatium (71.237.217.---)
Date: March 03, 2007 02:57PM

are you getting any kind of error message?

php already has a setting in the php.ini file of where temp files will be put, you dont need to add that code to your script
$_FILES['bulk_file']['tmp_name'] = c:/wamp/tmp\php3AE.tmp



CyberSpatium
----------------------------
Wamp English Forum Admin

Options: ReplyQuote
Re: File upload issue
Posted by: datinho (---.56-82-r.retail.telecomitalia.it)
Date: March 03, 2007 03:53PM

Hi,
maybe there was a misunderstanding, the equal means the current value of the variables:
$_FILES['bulk_file']['name'] its vaule is: bulk_import.csv
$_FILES['bulk_file']['type'] its vaule is: application/vnd.ms-excel
$_FILES['bulk_file']['size'] its vaule is: 529
$_FILES['bulk_file']['tmp_name'] its vaule is: c:/wamp/tmp\php3AE.tmp
$_FILES['bulk_file']['error'] its vaule is: 0

but on c:/wamp/tmp there isn't the uploaded file php3AE.tmp.

So how can I read or move a file that not exists?
I've tried with the function move_uploaded_file but I receive a missing stream error,
and I think that if the file is missing is difficult open a stream smiling smiley

Thanks in advance
Lorenzo



Post Edited (03-03-07 15:53)

Options: ReplyQuote
Re: File upload issue
Posted by: CyberSpatium (71.237.217.---)
Date: March 03, 2007 06:19PM

the tmp folder is outside you webroot, so you can not create files in it for security reasons. dont worry about where php stores temp files since php handles that for you.


CyberSpatium
----------------------------
Wamp English Forum Admin

Options: ReplyQuote
Re: File upload issue
Posted by: datinho (---.ip.fastwebnet.it)
Date: March 05, 2007 02:02PM

Hi,
thanks for the answer.

Thus with wamp I can't use the function move_uploaded_file, unless I move the temp dir
under the webroot.
Sometimes I need to move uploaded file to storage areas but i I can't handle the temp
file I'll never move it.

Now I look if change the standard config or find another way to solve this issue.
Bye, Lorenzo

Options: ReplyQuote


Sorry, only registered users may post in this forum.