[thelist] ASP file upload problems

Amy Johnson ajohnson at purplemountain.net
Sat Apr 20 15:30:01 CDT 2002


>From: Wade Armstrong <wade_lists at runstrong.com>

>>on 4/19/02 11:08 AM, Amy Johnson at ajohnson at purplemountain.net wrote:

>> Hi.  I am trying to set up a web site where the client can log in and upload
>> web images to the server.  I am using the
>> ASPSimpleUpload component.  My problem is security.  First we tried putting
>> the writeable directory in an area outside the web
>> space.  This worked great for uploading and deleting the files.  BUT the web
>> page could not access the images.

>The HTML you write out indeed can't access the image. But ASP can, since it
>runs under a different security context! Instead of <img
>src="uploads/picture.jpg"> try <img src="image.asp?image=picture.jpg">. The
>image.asp script then would open the image specified in the querystring, set
>the correct content-type, and output the image (actually, a straight
>Server.Transfer of the proper image might do the entire job in one line of
>code).

>Wade

Wade, thanks for the suggestion!  My ASP book gives some sample code for something like this but it says I need to get a
"third-party control" that will allow me to open a binary file.  They use ObjBin.ReadFile in their sample code.  Any idea where I
could get such a control?

Thanks!
Amy





More information about the thelist mailing list