Solved

File upload with ASP

Posted on 1999-01-27
6
212 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
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adapting Windows 7 Image for all HDD size 7 84
Convert MSI to MSM 1 75
Need to combine two scripts 2 33
Need help Creating PowerShell Script 5 53
Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

840 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