This content has been marked as final. Show 10 replies
The values of the PHP superglobal, $_FILES would help in deciphering what occurred within PHP. i.e., Was the image uploaded? Was there an error? ...
Using IIS this yields the following data on an example upload:
$_FILES = Array
[file] => Array
[name] => Thumbs.db
[type] => application/octet-stream
[tmp_name] => C:\temp\php6BC.tmp
[error] => 0
[size] => 10240
Also, where in the ADDT are you getting this error?
I first created an update form so that the admin can update certain records. But included on that same page is an image upload insert form. However i linked the update button to the insert form so there is an option to add a new image to the record.
I did all this the wrong way I think. I should have used insert into two tables?
I thought maybe i could just fix the image upload and everything would be okay.
The X/HTML <form /> element likely needs to have the following set:
Without that, the uploading of files does not work.
Also, if the two forms are linked, then there should only be one X/HTML <form /> element on the page. You should not be taking elements from one form and using them in another as this does not work by default. Nonetheless, a single form can have multiple submit buttons with multiple actions resulting from different submissions.
Okay I'm further along but I have another error.
File upload error: Error uploading file. Error moving uploaded file from temporary folder. (FILE_UPLOAD_ERROR)
Its also giving me this from the hosting directory.
Warning: unlink(c:\winnt\temp\php4\php5024.tmp) [function.unlink]: No such file or directory in D:\hshome\sweetlem\oiko.us\includes\common\lib\file_upload\KT_FileUpload.class.php on line 240
When I upload the file. The entry is put into the database. And if the folder for the image to be stored in, isn't there, it creates it no problem.
What's stopping the funcntion from going all the way through?
What are the permissions on the target directory? Does the web server account have write permissions to that directory?
You might try to manually create the destination directory and ensure that the web server account has permission to write to this directory. Also double check the permissions on an implicitly created target directory. You also need to look at the values in $_FILES to ensure the upload was successful before the error messages have meaning.
FYI, the unlink() command deletes a file.
Okay, i deleted the folder that i created which had a permission of 777 I then ran the upload for the image and i got the same error. But it created the new folder and it still had 777 as the permissions.
Should i contact the web host or is this an addt problem still?
tNG Execution Trace - VIEW
+ tNG_insert.prepareSQL + tNG_insert.executeTransaction - execute sql
# tNG_insert.afterUpdateField - file, granny_1600x1200_H.jpg
+ tNG_update.executeTransaction - execute sql
* tNG_insert.executeTransaction - execute sql
b * AFTER.Trigger_ImageUpload*
Until you add the print statement for $_FILES and share that I am done helping on this. Ensuring that the file was correctly uploaded is always the first step in debugging this type of problem, and you have not provided that info and I cannot provide any additional insight without it. An improperly configured <form> element can cause uploads to fail and you have yet to share that this part works and diverging to other topics before ensuring step 1 is correct is almost never fruitful.
I"ve fixed the solution thank you for all your help
I'm having this same problem. What was the fix here?
I checked perms on the target folder and the common/lib/file_upload/Temp folder which I had to create manually and chmoded to 777 as that has fixed this problem on some other sites.
Also I have the enctype="multipart/form-data" set in my form and there is only one form in the page.
Here is the output of my $_FILES var
[image_url] => Array
[name] => BIOPIC.jpg
[type] => image/jpeg
[tmp_name] => /tmp/phpdbaVLC
[error] => 0
[size] => 10413