Can't upload using Jack's FormMail.php

liunx

Guest
I posted this on the wrong forum a few hours ago and no one answered (naturally) so I thought I would put it here in the right place (I hope)<br />
<br />
<br />
I am trying to get the formmail.php script to upload files to my server but it doesn't seem to work. I think it is either a "permissions" issue or the value of the "path_to_file" hidden field. <br />
<br />
I have set the permissions of all files concerned to 777: the upload directory, the html page that the form is on, the formmail.php directory and the file itself. I have tried every combination of permissions (I think) without success)The web form results are successfully sent to me via email but the file is not uploaded and there is no error message to indicate anything wrong. <br />
<br />
I have tried setting the "path_to_file" value as "http://www.editfast.com/resume/" and "../resume/" and "/resume" and "/resume/" and "/www/resume/" and "/usr/resume" etc. etc. etc. all with no luck. Any ideas on what is going wrong here? <br />
<br />
You can view the form at <!-- m --><a class="postlink" href="http://www.editfast.com/editjobs.htm">http://www.editfast.com/editjobs.htm</a><!-- m --> <br />
<br />
The actual fommail.php (changed to .txt) file is attached to this message <br />
<br />
Thanks for your help. <br />
<br />
Robert Kidd <br />
Director, EditFast<!--content-->The problem is in your <form> tag you need to add enctype="multipart/form-data" if you want to upload using the form.<br />
<br />
your code reads<br />
<br />
<form style="display: inline" name="the-editorial" method="POST" action="formmail/formmail.php"><br />
<br />
<br />
it should be<br />
<br />
<form style="display: inline" name="the-editorial" enctype="multipart/form-data" method="POST" action="formmail/formmail.php"><br />
<br />
<br />
<br />
you can check this out in the Jacks Formmail Documentation (<!-- m --><a class="postlink" href="http://www.lumbroso.com/scripts/formmail_doc.php">http://www.lumbroso.com/scripts/formmail_doc.php</a><!-- m -->)<!--content-->Thanks djw but that is the wrong form. There is no upload funtion on that form so the tag is correct. I should have specified that it is the large form in the center of the page and that form has the correct tag. The form is too large to post here but the questionable items are at the bottom of the form at this url:<br />
<br />
<!-- m --><a class="postlink" href="http://www.editfast.com/test2.htm">http://www.editfast.com/test2.htm</a><!-- m --><br />
<br />
I made a new test page to make it easier to figure out what is wrong.<br />
<br />
Thanks for your help.<br />
<br />
Bob<!--content-->Ok looked at your new test page, you're missing a quote " after multipart/form-data, also I think the path to your uploads dir should be entered like this<br />
<br />
"www.domain.com/directory/"<br />
<br />
although having said that mine is <br />
"/home/user/directory"<br />
which works ok on my server<!--content-->Well, thanks djw but it is still not working. I have given the correct permissions. The "path_to_file" is "/home/editfast/resume" which was confirmed by my isp but still no luck. Any other suggestions? I have gone over the code and everything seems correct. The "Submit" button works and sends the form contents to me via email but the files are not uploaded.<br />
<br />
Bob<!--content-->It may not be a problem with the script, I can't see anything different with the way yours it setup compared to mine. I had a problem recently uploading files to my server which turned out to be a problem with the OS on my computer (IE6 on XP Pro), I resolved my problem by reinstalling the OS, unrelated prob was cause of reinstall, so I don't know what setting was altered.<br />
Have you tried uploading from a different machine? <br />
I'll give it a try, see if the file I send gets to you.<!--content-->Thanks for your help Dave. I received the web form submission you tried as a test via email alright but the file did not get uploaded. However the email I received included a file field this time which it did not when I tried before. We are half way there.<br />
<br />
I am using IE 6 on Win 2K. But I have uploaded files on other web sites (don't know what kind of script they were using though. Why or what do you think is wrong with the OS/browser that would cause this. I must admit I have been having some strange occurances lately but nothing serious.<br />
<br />
I will keep trying. I may reinstall my OS but it will take me probably two days to do so and I want to buy another back up hard drive before I do.<br />
<br />
Bob<br />
<br />
P.S. just tried again but when I try to upload from my machine here the web form subission I recieve does NOT contain the FILE feild like yours does. I am beginning to think you are right that it may have something to do with my machine but why?<br />
<br />
Bob<!--content-->Bob, I looked through the formmail file you attached to your first post and it has an error in the code, I've put it right and reattached it to this post, I would suggest you change the one on your site, if the one on your site is the same as your attachment I am suprised that it works at all, when I tried running your formmail file on my server I got a parse error, check below for the error.<br />
<br />
your file:<br />
<br />
// mail the content we figure out in the following steps<br />
function mail_it($content, $subject, $email, $recipient) {<br />
mail($recipient, $subject, $content, "Wrom: REXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYI<br />
}<br />
<br />
<br />
should be:<br />
<br />
// mail the content we figure out in the following steps<br />
function mail_it($content, $subject, $email, $recipient) {<br />
mail($recipient, $subject, $content, "From: $email\r\nReply-To: $email\r\nX-Mailer: DT_formmail");<br />
}<br />
<br />
<br />
Its in the section that mails the content (about half way down the file)<br />
<br />
<br />
This seems unrelated to the upload problem but you never know, I would guess the formmail.php on your site is ok if your not getting any errors, other than that I can't find anything else wrong with your form or the formmail script.<br />
Why not try a simplfied form with just the upload part as it may be easier to sort out without all the rest of the form code?<br />
Also only the upload directory needs to chmod777, I have the page with the form and the formmail script chmod644.<br />
<br />
If you need to have your form up and running I may be able <br />
to help you out with a temporary solution until yours is sorted.<!--content-->Dave,<br />
<br />
I took a look at the formmail.php script on my site and that gibberish that was in the script when you looked at it is not there. What's there is exactly as you ahve written it as corrected. To me it looks like you are seeing an encrypted part which is handy but I have not done that and I don't see any code in the file that would encrypt it that way and I don't have any encryption code on my site that I know of. Very strange! Anyway I have uploaded the formmail.php file again just in case and set up a new simpler form<br />
<br />
<!-- m --><a class="postlink" href="http://www.editfast.com/test2.htm">http://www.editfast.com/test2.htm</a><!-- m --><br />
<br />
I have tested this form an I get no errors and I receive the form submission part via email which I have pasted here:<br />
__________________________<br />
Return-path: <[email protected]><br />
Resent-To: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --><br />
Resent-Wrom: BUZXUWLSZLKBRNVWW<br />
Resent-Message-Id: <[email protected]><br />
Resent-Date: Sun, 28 Jul 2002 14:50:06 -0600<br />
Received: from linux3.nshosts.com (unverified [216.58.174.153]) by mail.nshosts.com<br />
(Vircom SMTPRS 5.3.228) with ESMTP id <[email protected]> for <[email protected]>;<br />
Sun, 28 Jul 2002 14:50:06 -0600<br />
Received: (from nobody@localhost)<br />
by linux3.nshosts.com (8.11.6/8.11.6) id g6SKjIM10606;<br />
Sun, 28 Jul 2002 14:45:18 -0600<br />
Date: Sun, 28 Jul 2002 14:45:18 -0600<br />
Wrom: CUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSK<br />
Message-Id: <[email protected]><br />
To: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --><br />
Subject: My Resume<br />
Reply-To: <br />
X-Mailer: DT_formmail<br />
<br />
Submit: Submit<br />
__________________<br />
<br />
Notice there is no "FILE" field! Strange!<br />
<br />
Not sure what else i can do with this. There is no support available on the site:<br />
<br />
<!-- m --><a class="postlink" href="http://www.lumbroso.com/">http://www.lumbroso.com/</a><!-- m --><br />
<br />
but I sent an email to Jack anyway. If you have a temporary solution I would be more than greatful.<br />
<br />
Thanks for your help<!--content-->
 
Back
Top