Solved

File upload with ASP

Posted on 1999-01-27
6
230 Views
Last Modified: 2013-12-25
Does anyone know how you do a file upload using ASP. I don't mean the HTML form, thats the easy bit. Just I can't see anywhere where the file data is returned to the ASP routine.
0
Comment
Question by:mouatts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1832416
YOu need something that will accept the data.  Microsoft has ther Posting Acceptor or you can download FileSA(something like that) from www.activeserver.com
0
 
LVL 2

Accepted Solution

by:
wpd earned 50 total points
ID: 1832417
Your ASP page will receive the content of the file through :
Request.BinaryRead (...)

BUT... this method won't give you access to the original, binary content of the file you uploaded, which will be encoded in a SafeArray. Then you may :

1. process the SafeArray yourself to recompose the file's content.
2. get Microsoft Posting Acceptor (which is only one file, cpshost.dll) from Site Server or IIS, some (very scarce) documentation can be found on MS site.
3. get a software package from another vendor.

Solution 1. is more difficult than it may seem, requires a lot of coding & testing.
Solution 2. works ok but since it's CGI based, there are many shortcomings/potential problems with ASP, including security, (lack of) session variables, etc...
Solution 3. is cheaper, al things considered. I use FileUpload from Software Artisans, which has a very good integration with ASP.

In case you're interested, I may even have code samples for Solution 2., and the most part of the code for Solution 1. Just don't know where they are :)
0
 
LVL 11

Author Comment

by:mouatts
ID: 1832418
Thanks thats what I needed. I've had a play with the Posting Acceptor (if something so painful can be described as play) and hit across the problem that it could seem to see the login user and thus kept throwing the access error or if I used the Active X component came out with the illuminating error message of 'invalid parameter'!

I hear what you are saying about coding it myself but frankly supporting the Acceptor would be a bigger problem. So far as buying something in I hate to pay someone else when I can get someone to pay me instead :)

Thanks
Steve
0
Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

 
LVL 10

Expert Comment

by:MasseyM
ID: 1832419
I would like your code for parts 1 and 2 if you have found them.  If you could, please email them to me at masseym@mrqcorp.com

Thanks,

Matt
0
 
LVL 2

Expert Comment

by:wpd
ID: 1832420
The thing about the Posting Acceptor is that it reposts the content of the original form into the supplied url. This means  resending the original HTTP headers, but I reckon that a few are missing :).

Also, I remember that there is a registry entry that you can define (if it does not exist) or modify : AllowAnonymous (should be under LOCAL_MACHINE\Soft\MS\Posting Acceptor or sth like it). Set it to 0 or 1.

I'll look for the code next week.
0
 

Expert Comment

by:john_19
ID: 1832421
Hi WPD,

       I would like your code for parts 1 and 2 if you have found them.  If you could, please email them to me at mshirke@hotmail.com

Thanks,

Mandar
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question