I have a script that uploads a jpg from a form. PHP handles the form
The image is stored in a folder and I have permissions
Works great on my old computer (xp-pro) and on the apache server
Does not work in new computer / new PHP install
This is what displays on the local server / vista / IIS7
debugging info:Array ( [img1] => Array ( [name] => Desert Landscape.jpg [type] => [tmp_name] => [error] => 6 [size] => 0 ) )
This is the correct display on the Apache server
debugging info:Array ( [img1] => Array ( [name] => Autumn Leaves.jpg [type] => image/pjpeg [tmp_name] => /tmp/php6nXuLM [error] => 0 [size] => 276216 ) )
Maybe I do not have .jpg support on my latest PHP install or GD2 support is not working - or...
Any idea what the problem might be?
I have checked the php.ini and it seems all the options needed are available and unremarked
I have the mbstring before the efix in the PHP.ini file
been at this for 5 days and any help would be appreciated!!!
David
Problems uploading .jpg image to folder
Moderator: General Moderators
ppgpilot wrote:This is what displays on the local server / vista / IIS7
debugging info:Array ( [img1] => Array ( [name] => Desert Landscape.jpg [type] => [tmp_name] => [error] => 6 [size] => 0 ) )
You have to set a valid value for upload_tmp_dir in your php.inihttp://de2.php.net/features.file-upload.errors wrote:Error Messages Explained
[...]
UPLOAD_ERR_NO_TMP_DIR
Value: 6; Missing a temporary folder.
- harsha
- Forum Contributor
- Posts: 103
- Joined: Thu Jul 11, 2002 1:35 am
- Location: Bengaluru (Bangalore) > Karnataka > India
When you try to upload a file to the server using a php script
the file first sits in a temporary directory
(the location/path of this temporary folder is configurable, means you can specify the temporary folder, on UNIX it is /tmp Iguess)
once the file is uploaded it is programmers responsibilty to programatically move the file to the desired location on the
server with the scope/permission granted to the user.
file upload is independent you upload jpeg/exe or what ever it does not depend on the related library
also there is a upload size limit set (in php.ini ); by default it is 2mb
if the file size exceeds this limit error is thrown back.
the file first sits in a temporary directory
(the location/path of this temporary folder is configurable, means you can specify the temporary folder, on UNIX it is /tmp Iguess)
once the file is uploaded it is programmers responsibilty to programatically move the file to the desired location on the
server with the scope/permission granted to the user.
file upload is independent you upload jpeg/exe or what ever it does not depend on the related library
also there is a upload size limit set (in php.ini ); by default it is 2mb
if the file size exceeds this limit error is thrown back.
Thank you for your reply!
I am with you on all you mention -
I have specified a temp folder in the php.ini - have tried several folder locations - have checked permissions for all folders tried - and of course the script works great on the Apache Server and on my other laptop running XP-PRO on a local IIS6 server.
The only vairable on my new computer is
a new PHP install - new php.ini (I have set it up the same as my old php.ini from XP-PRO)
and the Vista OS - with its permissions issues -
and IIS7
My PHP.ini is set as follows
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = c:\tmp\
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M
Everything comes accross to the database
In your opinion, is the problem on Vista and a folders permission issue or in the PHP.ini / install?
PHPinfo() shows appropriate extensions active for file upload and support - or maybe I am missing something here ....
Everything should be working but still I am not getting the full $_FILES array to list: including the fiel tmp_name / file type / file size -- only the img name appears... What would cause this?
Thanks for your help!!!
David
I am with you on all you mention -
I have specified a temp folder in the php.ini - have tried several folder locations - have checked permissions for all folders tried - and of course the script works great on the Apache Server and on my other laptop running XP-PRO on a local IIS6 server.
The only vairable on my new computer is
a new PHP install - new php.ini (I have set it up the same as my old php.ini from XP-PRO)
and the Vista OS - with its permissions issues -
and IIS7
My PHP.ini is set as follows
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = c:\tmp\
; Maximum allowed size for uploaded files.
upload_max_filesize = 20M
Everything comes accross to the database
In your opinion, is the problem on Vista and a folders permission issue or in the PHP.ini / install?
PHPinfo() shows appropriate extensions active for file upload and support - or maybe I am missing something here ....
Everything should be working but still I am not getting the full $_FILES array to list: including the fiel tmp_name / file type / file size -- only the img name appears... What would cause this?
Thanks for your help!!!
David
please tryand post the output.
Code: Select all
<?php
$d = get_cfg_var('upload_tmp_dir');
echo 'ini: ', get_cfg_var('cfg_file_path'), "<br />\n";
echo 'upload_tmp_dir: ',
is_dir($d) ? 'd':'-',
is_readable($d) ? 'r':'-',
is_writable($d) ? 'w':'-',
is_executable($d) ? 'x':'-',
' ', $d,
"<br />\n";