File Upload To Server - Problem

Thread Solved

Join Date: Jul 2005
Posts: 187
Reputation: aparnesh is an unknown quantity at this point 
Solved Threads: 10
aparnesh's Avatar
aparnesh aparnesh is offline Offline
Junior Poster

File Upload To Server - Problem

 
0
  #1
Nov 28th, 2007
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

  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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: File Upload To Server - Problem

 
0
  #2
Nov 28th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 187
Reputation: aparnesh is an unknown quantity at this point 
Solved Threads: 10
aparnesh's Avatar
aparnesh aparnesh is offline Offline
Junior Poster

Re: File Upload To Server - Problem

 
0
  #3
Nov 29th, 2007
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 ?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: File Upload To Server - Problem

 
0
  #4
Nov 29th, 2007
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?
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: File Upload To Server - Problem

 
0
  #5
Nov 29th, 2007
could also go straight by microsoft for another way advanced way:

http://support.microsoft.com/kb/299692
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 187
Reputation: aparnesh is an unknown quantity at this point 
Solved Threads: 10
aparnesh's Avatar
aparnesh aparnesh is offline Offline
Junior Poster

Re: File Upload To Server - Problem

 
0
  #6
Nov 30th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: File Upload To Server - Problem

 
0
  #7
Dec 1st, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC