944,178 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Marked Solved
  • Views: 2874
  • ASP RSS
Nov 28th, 2007
0

File Upload To Server - Problem

Expand Post »
I am trying out the process of uploading a file from a browser to the IIS 5 server. I have installed the MS Posting Acceptor (cpshost.dll) and the file exists in the C:/InetPub/Scripts folder. I restarted IIS after the installation.


The Code for Posting the file is

ASP Syntax (Toggle Plain Text)
  1. <FORM EncType="multipart/form-data" ACTION="http://localhost/Scripts/cpshost.dll?PUBLISH? http://localhost/Exprmnt/FileRecv.asp" METHOD="Post">
  2. <TABLE WIDTH="60%" BORDER=2 ROWS=2 COLS=2>
  3. <TR> <TD><B>Select The File To Upload</B></TD>
  4. <TD><INPUT TYPE="File" NAME="File1" id="File1"></TR>
  5. <TR><TD COLSPAN=2 Align="Middle"><INPUT TYPE="Submit" NAME="Upload" VALUE="Upload"></TD></TR>
  6. </TABLE>
  7. </FORM>

After clicking the upload button, I am getting a Blank page with the title "Upload Status" and the address bar shows
ht tp://localhost/Scripts/cpshost.dll?PUBLISH?http://localhost/Exprmnt/FileRecv.asp
But the code in the FileRecv.asp page is not getting executed.

What am I doing wrong ?

{Note: I made changes to the url addresses in this post because the display was incorrect. It is actually http and NOT ht tp in the address bar }
Last edited by aparnesh; Nov 28th, 2007 at 6:12 am.
Similar Threads
Reputation Points: 20
Solved Threads: 10
Junior Poster
aparnesh is offline Offline
193 posts
since Jul 2005
Nov 28th, 2007
0

Re: File Upload To Server - Problem

try removing the PUBLISH? command from the line. As far as I know, that should not be in there. Also, why are you using a DLL for this simple thing? All you would have to do is upload the file and save it to a directory.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 29th, 2007
0

Re: File Upload To Server - Problem

I looked up the relevant part in MSDN and the code there specifies PUBLISH. It's like ...cpshost.dll?PUBLISH?<<Page That should come after file Upload is complete>>

I know all I have to do is upload the file and save it to a directory. Also the file information should be available to a page that will process the file. So how do I do it ?
Reputation Points: 20
Solved Threads: 10
Junior Poster
aparnesh is offline Offline
193 posts
since Jul 2005
Nov 29th, 2007
0

Re: File Upload To Server - Problem

http://www.freevbcode.com/ShowCode.asp?ID=4596

This will give you the code so you don't have to do anything besides some basic editing. The backend file you do not have to touch at all. The front end file (name: ...Test) you need to set file names or whatever. Completely done for you and free. All you have to do is call the new properties and submit (which are already done for you on the name:...test page). Otherwise, what you have to do is request all files from the page (or just request one with the name), then save it. This goes way out far and beyond of what is needed, but hey.. extra isn't bad right?
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 29th, 2007
0

Re: File Upload To Server - Problem

could also go straight by microsoft for another way advanced way:

http://support.microsoft.com/kb/299692
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007
Nov 30th, 2007
0

Re: File Upload To Server - Problem

Thanks for your suggestions.

I tried out my solution (that was not working) again as I couldn't find any reason why it shouldn't. Then I realized I have to create a Virtual directory in IIS and set write permission for it. The Uploaded files should be saved in that folder. Create the directory, set the 'save file into folder' part, ran the code again ... and it worked perfectly.

The MS solution you pointed to provides a way for writing a dll (in VB) for uploading. As the Posting Acceptor does the same job, I didn't want to write that part again.

Haven't checked out the freevbcode sample, will do later. Since it provides an ASP class for uploading, it probably would involve either creating a dll or including the class file.

Thanks again for your help
Reputation Points: 20
Solved Threads: 10
Junior Poster
aparnesh is offline Offline
193 posts
since Jul 2005
Dec 1st, 2007
0

Re: File Upload To Server - Problem

Yeah you would have to include the class file, that's all. It was all written, you just provide the path and the names of the files and it auto saves it accordingly.

I thought you already had the folder and write permissions set to it, so I didn't suggest that. Sorry, could have saved you time and trouble.
Reputation Points: 43
Solved Threads: 68
Veteran Poster
SheSaidImaPregy is offline Offline
1,080 posts
since Sep 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: help in ASP.Net is needed saving excel sheet
Next Thread in ASP Forum Timeline: Ho do I change the server time to my own time zone?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC