locked
Form Authentication Problem RRS feed

  • Question

  • Hi All,

    I am a newbie and having some trouble with an online form I have created.

    I wanted results of the form to be emailed to myself including upload attachments. Firstly, the form details suggests that the uploaded files would have to be stored in a file at the server. Is this correct or can it be send to me as an email attachment??

    Secondly, when I click the submit button, a pop up box says "Authentication required", asking for username and password.
    Clearly I was hoping for it to simply post the form data to me. Can anyone help me out?

    Not sure if it is of help but here is the coding I have used. I have left out the fields for simplicity..

    <form id="form1" action="--WEBBOT-SELF--" enctype="multipart/form-data" method="post" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit="">
                                <!--webbot B-Email-Label-Fields="TRUE" bot="FileUpload" S-Builtin-Fields="" S-Destination="quotes/" S-Email-Address="....@....com" S-Email-Format="HTML/BR" U-Confirmation-Url="thankyou.html" startspan B-Process-MetaInfo="FALSE" S-Assignedto="" S-Category="" S-ReviewStatus="" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><input TYPE="hidden" NAME="_charset_" VALUE="iso-8859-1"><!--webbot bot="FileUpload" endspan i-checksum="55656" -->
                            <table style="width: 440px" cellpadding="0" cellspacing="0" class="style9">

    <input name="Submit" type="submit" value="Submit" class="style8" /></td>

    Thanks guys
     
    Wednesday, April 15, 2009 11:57 PM

All replies

  • Too bad you can't do it with PHP as I have a sample for Sending a Form, with Attachments, to an email address .  Since you are using FP extension someone with experience in that will have to chime in.  My gut feeling is you can't do what you want with the current methods you are using and you will end up using something like PHP.

    --
    Chris Hanscom - Microsoft MVP
    Resource Center | Veign's Blog | Web Development Help
    • Proposed as answer by Veign Sunday, April 19, 2009 2:43 PM
    Thursday, April 16, 2009 12:10 AM
  • not being a user of web-bots and being a user of php myself i cannot give too much info on this, however from what I can tell and the error message you are experiencing, it highly suggests this to be an issue with the upload of the file.

    Check several things:
    1. Is the web-bot set up to email correctly - i.e. do you get the email if you do not attach a file?
    2. Is the web-bot/form set to upload the file to a specific folder?  If so, do you have correct permissions on this folder - try chmod-ing the file to 777 via your web host control panel/ftp client and try again, then adjust permissions as required - 755 should do.
    3. Does the web-bot have permission to send the email via your host - i.e. is it set up correctly with email authentication details?

    Personally - I would change to php for the form if handled by your web host.

    generally the practice is that to get a file sent to you it would need be uploaded to your server first then emailed out, this is because things happen sequentially on web hosting, with files being retrieved first then sent.

    I would strongly suggest looking into a CGI handler if you cannot use PHP (but check out PHP first!) - check with your webhost as they may have a pre-installed one you can use.  I would say though that i would recommend against using a web-bot for forms, they can be very useful but they can be troublesome, particularly if you are a newbie.

    I would look in to the web-bot configuration, or preferrably scrap it altogether and change the form handler to PHP using Veign's suggestion and tutorial above.  This will make it much easier to maintain and configure and offers more functionality for later adaptation of the form

    Thursday, April 16, 2009 9:38 AM
  • To upload files using the FrontPage extensions you must be hosted on a Windows server -Unix servers will not work. The uploaded file will NOT be emailed to you, but the filename should be.

    The permissions problem probably comes from the quotes folder - this must have permissions for saving data from anonymous uploads.
    Open the live (on the server) website in Expression Web
    Right click on the Quotes folder and choose Properties.
    Clear the checkbox "Allow scripts to be run"
    Tick the boxes "Allow anonymous upload to this directory" and (optionally) "Allow uploaded files to be overwrite existing filenames"


    Microsoft MVP (Expression) http://www.rxs-enterprises.org/fp
    Thursday, April 16, 2009 11:11 AM
  • It's kind of a cheat, but why don't you use a form generator like Coffee Cup?

    You wouldn't need the dead, no-longer-supported FPSEs; you could use ASP.NET of PHP, whichever is on your server, and the code gets written for you, just copy, paste, upload. There are other form generators out there too., as Chris noted.

    If you're new at this and trying to learn, I wouldn't spend any time on FPSEs.
    Thursday, April 16, 2009 12:12 PM
  • Thank you everyone for your responses and suggestions. I have a windows hosting package which also has PHP capability which I have enabled.

    Veign - You have written a great programme but unfortuantely I am not expert enough to be able to transfer across to my situation.

    Mattcp - unfortuantely I do not know how to check the bots and am unsure about chmoding.

    _Ronx - Although the form field mentions a quotes folder, I do not have one in my files or at the server. However, I ideally want the files/documents to be emailed directly to me. I do not want them to sit in a folder on the server if this makes sense.

    Bill Pearson - I had a look at a few generators and tried inserting bits of code but couldn't get the form to work.

    Basically I have spent a lot of time getting the design right (for me at least) and am confused as to how to make this work. I can have a php form but its beyond my capability. Therefore, if I cannot get it to work, I shall simply remove form and leave an email address which I accept isn't very professional.

    If any of you think you could sort this out for me, please email me at nelly_dr@hotmail.com. I shall give you the website URL so you can take a look at it and the source code. Please then give me a quote for doing the work. I have a Paypal account but not much money!!

    Thanks again to all of you who have posted.
    Thursday, April 16, 2009 8:32 PM
  • Take my sample and upload it to your website.  Open the files and you'll see where to change the To email address.  The sample is a complete working sample that should work without any mods except the To email address.
    --
    Chris Hanscom - Microsoft MVP
    Resource Center | Veign's Blog | Web Development Help
    Thursday, April 16, 2009 8:39 PM
  • If you don't have a quotes folder, then either make one, both locally and on the server, and modify the permissions. Better still, go with Veign's suggestion since it should be able to email the file as well.  You may still have to create a folder for the files as they are uploaded for temporary storage.
    Microsoft MVP (Expression) http://www.rxs-enterprises.org/fp
    Friday, April 17, 2009 9:40 AM
  • The files will be uploaded to the server's temporary storage folder until the session has expired and then they will become unlinked and purged on the next garbage collection. You cannot change that, it's the way servers work. If you wish to keep a copy of the uploaded file on the server then you need a server-side script to move the file from temp to permanent storage after it finishes uploading.
    You do not need any bots at all and can send all the data to your email address as long as you don't mind the format which can be quite messy using that method. On top of that it is also very dangerous to accept email attachments uploaded to a page unless you know who they are coming from at all times and no outsiders can get access to the page.

    At the very least find out whether you have ASP or PHP as the primary server-side language on your server and get someone to write you a script to handle all of this...to a decent coder it is a 15 minute job, nothing more. If you don't you are likely to have problems with this on a regular basis. Do things properly and you can't go far wrong.
    Life Is...
    Friday, April 17, 2009 9:58 AM
  • Better still, go with Veign's suggestion since it should be able to email the file as well.  You may still have to create a folder for the files as they are uploaded for temporary storage.
    Microsoft MVP (Expression) http://www.rxs-enterprises.org/fp
    What mine does is store the file in the temporary storage as defined in the PHP.ini file - this is setup when the hosting account is setup.  The file never gets moved to the local web folder.  It would be pretty simple to also keep a copy of the file on the server.  By default my sample should just work as the temp file location is almost always setup with the proper permissions.

    --
    Chris Hanscom - Microsoft MVP
    Resource Center | Veign's Blog | Web Development Help
    Friday, April 17, 2009 2:00 PM
  • It's kind of a cheat, but why don't you use a form generator like Coffee Cup?

    You wouldn't need the dead, no-longer-supported FPSEs; you could use ASP.NET of PHP, whichever is on your server, and the code gets written for you, just copy, paste, upload. There are other form generators out there too., as Chris noted.

    If you're new at this and trying to learn, I wouldn't spend any time on FPSEs.
    Hi, Bill. Just a heads up on this. I've got the latest Coffeecup Form Builder and, according to the docs and tuts, as of version 7.5 it supports PHP or ASP, but I didn't see anything about ASP.NET. From the manual:

    ASP/PHP Compatible – yep, now you can use PHP or ASP to power your forms

    This is actually good, since either Classic ASP or PHP can be pretty much counted on to be found on most servers. I agree with you on the suggestion, BTW. CFB has a dead-simple GUI interface for creating forms with assorted graphical options, sending to one or mulitiple recipients, uploading files, entering sent data into a MySQL db, all the stuff that gets asked for here all the time. For straightforward "send me an email" applications I've deployed Chris's lightweight simple email form very easily. But for folks who want to get a little fancy with their forms, include multiple options, write results to a db, and have fill-in-the-blank setup and configuration, CFB is hard to beat.

    cheers,
    scott
    Friday, April 17, 2009 4:45 PM
  • Thanks again everyone.

    I spoke with my hosting company Technical support department and they think I have a script error. Apparently, I cannot send email form the server either and therefore I have been told to configure to use localhost and port 25.

    I am very lost now and thinking of settling for simply having an email address on the page. Anyone who thinks they can sort this out for me? Unfortuantely I'm in over my head now. I have already designed the form and thank-you pages, so its a case of getting the coding correct.

    Any takers? Otherwise I will probably have to post a job on elance... 
    Sunday, April 19, 2009 1:04 PM
  • Sounds like a hosting problem.  Did you try just using a very basic form to email script and see if even that will work?
    --
    Chris Hanscom - Microsoft MVP
    Resource Center | Veign's Blog | Web Development Help
    • Proposed as answer by Veign Sunday, April 19, 2009 2:42 PM
    Sunday, April 19, 2009 1:34 PM
  • Hi Veign,

    I decided to do away with the attachments, so I technically have a basic form script which doesn't work.

    I tried your programme but on the thank you page I get an error message at the bottom saying "error moving file". No email was received either.

    I have this hosting package: http://www.webhosting.uk.com/windows-hosting.php


    Sunday, April 19, 2009 1:50 PM
  • No email was received since it couldn't write the file to the temp folder and the script just ended with the error.  Try the sample I posted above and see if that will send an email - DO NOT forget to update the To email address in the script.  Also, make no other changes and use the exact sample pages in the zip file.
    --
    Chris Hanscom - Microsoft MVP
    Resource Center | Veign's Blog | Web Development Help
    Sunday, April 19, 2009 1:55 PM
  • Also, your current hosting package should easily handle the PHP scripts.
    --
    Chris Hanscom - Microsoft MVP
    Resource Center | Veign's Blog | Web Development Help
    Sunday, April 19, 2009 2:00 PM
  • I get the exact same errors as before but there is some good news. It works perfectly if I don't send an attachment!!

    Good enough for me! I will somehow try to integrate your coding into my page...

    Thanks very much!
    Sunday, April 19, 2009 2:32 PM
  • Glad you got it working.  If it won't send the attachments because of the moving file error then you have a permission problem on your server.  Should be fairly easiy to fix, in fact there may be an FAQ on it from your web host.
    --
    Chris Hanscom - Microsoft MVP
    Resource Center | Veign's Blog | Web Development Help
    Sunday, April 19, 2009 2:42 PM
  • Scott:

    Thanks for that catch, I didn't check Coffee Cup before listing ASP.NET. I was just picturing the window in my mind where you make the choice. Whoops!

    I've just started using it for a couple of sites (on a friend's recommendation), but only for PHP. It is dead easy, but I feel dirty using it because it is so simple. ;-)
    Sunday, April 19, 2009 11:57 PM
  • Don't, I use several little specialty apps because it is a more efficient use of my time.
    MS MVP Expression Tutorials & Help http://by-expression.com and online instructor led Expression Classes
    Monday, April 20, 2009 2:45 PM