| | |
File Upload To Server - Problem
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
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
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 }
The Code for Posting the file is
ASP Syntax (Toggle Plain Text)
<FORM EncType="multipart/form-data" ACTION="http://localhost/Scripts/cpshost.dll?PUBLISH? http://localhost/Exprmnt/FileRecv.asp" METHOD="Post"> <TABLE WIDTH="60%" BORDER=2 ROWS=2 COLS=2> <TR> <TD><B>Select The File To Upload</B></TD> <TD><INPUT TYPE="File" NAME="File1" id="File1"></TR> <TR><TD COLSPAN=2 Align="Middle"><INPUT TYPE="Submit" NAME="Upload" VALUE="Upload"></TD></TR> </TABLE> </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.
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 ?
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 ?
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
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?
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?
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
could also go straight by microsoft for another way advanced way:
http://support.microsoft.com/kb/299692
http://support.microsoft.com/kb/299692
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
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
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
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.
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.
![]() |
Similar Threads
- Problems with file upload (PHP)
- File Attachment Small Problem (PHP)
- problem with counter (PHP)
- file upload code.....need attention (PHP)
- File uploading with PHP on server (PHP)
- Problem in Uploading Files using Register Global on/off (PHP)
- File upload problem (PHP)
- "Cannot find server or DNS Error" and Trojan Virus (Viruses, Spyware and other Nasties)
Other Threads in the ASP Forum
- Previous Thread: help in ASP.Net is needed saving excel sheet
- Next Thread: Ho do I change the server time to my own time zone?
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection diagnostics dreamweaver excel fso iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit webserver windows7






