Solved

File upload with ASP

Posted on 1999-01-27
6
193 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now