I'm using formmail.php in a new site for form-to-email. Everything works great, until I try to upload a file. Then instead of sending me to the redirect page, it gives me this:
Warning: Unable to create '/questionmark.jpg': Permission denied in /home/demodemo/public_html/formmail.php on line 276
Warning: Cannot add header information - headers already sent by (output started at /home/demodemo/public_html/formmail.php:276) in /home/demodemo/public_html/formmail.php on line 323
The page with the form I'm working on is at http://www.demodemo.com/hostingtutorials.html
Any ideas?
Vito
A bit of progress made, but still not quite right. I managed to stop getting the error. I had to change name=file to name=file_name.
The problem now is that when submitted, the form sends me an email, but I can't seem to get the uploaded file. In the documentation it says that one of the hidden variables should be:
<input type="hidden" name="path_to_file" value="/www/dir_where_file_goes/">
So I created a new directory on my server. Let's say it's called "uploads". Then in the form I put in the variable. For the value, I tried every combination I could think of:
/home/username/public_html/uploads/
/www/uploads/
http://www.mysite.com/uploads/
...well, you get the idea.
I even tried every combination without the trailing slash. Yet after submitting the form, I do not see any file in the directory on my server.
IMO, the variable is what is giving me the problem. Anyone know what path I should use? Any wisdom on this would be greatly appreciated.
Vito
choon
09-06-2002, 02:35 AM
Hi,
Without looking at your script/form, try to check your php configuration (normally is /etc/php.ini) whether does the file_uploads being set to On or Off.
If it is set to Off, try to enable it by changing it to On then restart your web server. If it is already set to On, then it is some other issues for you to look at your script/form or upload directory permission etc...
Just my suggestion and no... I am not good in term of php ;)
Thanks.
Kindest regards,
Choon
Thanks Choon:
I didn't have to bother checking if it was turned on or off because I tried another script from hotscripts and it worked OK. I was able to upload. It's too bad, though. I prefered the first script, but couldn't waste any more time with it, so I just went with the hotscripts one.
Thanks for your input. :)
Vito
benoire
09-06-2002, 07:41 AM
Is this issue closed now or do you still want assistance with your first script? :)
Hi benoire:
Well I guess for now it's a closed issue. I couldn't spend more time on it, so I had to find an alternative. What I really wanted was a form where the customer could fill in his name etc, choose the products he wants to order, and upload an image...all in the same form. He would then be forwarded to a page to process payment.
As it turns out, I now have him doing all of the above with the exception of the upload. He has to proceed to a separate page to upload, then advance to make payment. It means one extra clcik.
But thanks for the offer to help. :)
Vito
Vito,
Have you given correct permissions for target directory? Give it a 777 permission, test it and then decrease permission level if it works.
Mac
Yup, I tried 777. Still didn't work... :(
Vito