Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File upload problem with empty input box

Status
Not open for further replies.

tvbruwae

Programmer
Aug 9, 2001
224
EU
Hi

I'm using an ASP form to send some data to an IIS web server. I also want the users to be able to add an additional file, so I included a "file" input field and installed the necessary dll on IIS to make the upload possible.

Everything works as it should, except when the file input field is left blank. Then I get a http 500 error and my processing ASP page is not displayed. Since the other (regular) fields aren't sent to the server either (normally I would see the entries in a database on the server) this means that the ASP page processing the form isn't even started.

I'm using the syntax as described on the Microsoft site (MSDN library, "the posting acceptor"), so I think this may be a rather simple problem (especially since the upload works, and that should be the most difficult part...).

This is some of the code :

strServerURL = " + Request.ServerVariables("SERVER_NAME")
strTargetURL = strServerURL & "/WebrepFiles"
strRepostURL = strServerURL & "/Webreporting2/process.asp"
strPathToPA = strServerURL & "/Scripts/cpshost.dll"
strPostingURL = strPathToPA + "?PUBLISH?" + strRepostURL

'Setting the location variables server-independent (MS)

<FORM method=&quot;POST&quot; action=&quot;<% =strPostingURL %>&quot; id=form1 name=form1 enctype=&quot;multipart/form-data&quot;>
<input type=&quot;hidden&quot; name=&quot;TargetURL&quot; value=&quot;<% =strTargetURL %>&quot;>

'The form header and hidden target field

Any tips?

Thanks

Tim
 
what is ?PUBLISH? ?
has it got anything to do with the file uploaded? since this is part of the form action URL, i'd question if it's getting built correctly.

strPostingURL = strPathToPA + &quot;?PUBLISH?&quot; + strRepostURL

or, can you post how you process and what you do with a file that is uploaded, and is there an alternate process if the file doesn't exist?
 
Actually, I don't know myself. I know it's silly to use code without knowing what it does, but this &quot;?PUBLISH?&quot; clause is used in the examples on the Microsoft site, and I simply copied these lines into my project.

The URL for this example is

I'll try to execute the form with an absolute path first to see if this could be the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top