For Programmers: Free Programming Magazines  


Home > Archive > ASP > November 2005 > how to send binary files and protect their file names









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to send binary files and protect their file names
Tomas PAJER

2005-11-26, 6:55 pm

I have many office files saved in sql server. The system sends them by one
web page: RequestFile.asp. So every file has the same name requestFile.asp.

How can i change requested URL on the server from
www.domain.com/requestFile.asp to www.domain.com/someFileName.doc????

I am able to rise "Save or open downloaded file" dialog, but this does not
help me at all.

Thank you very much.

Tom
PJones

2005-11-27, 3:55 am

check out www.aspprotect.com
or search www.aspin.com


"Tomas PAJER" <TomasPAJER@discussions.microsoft.com> wrote in message
news:A63AA81C-25CF-41E7-89C8-DA5C04928558@microsoft.com...
>I have many office files saved in sql server. The system sends them by one
> web page: RequestFile.asp. So every file has the same name
> requestFile.asp.
>
> How can i change requested URL on the server from
> www.domain.com/requestFile.asp to www.domain.com/someFileName.doc????
>
> I am able to rise "Save or open downloaded file" dialog, but this does
> not
> help me at all.
>
> Thank you very much.
>
> Tom



Patrice

2005-11-28, 7:55 am

Not sure if this is a problem with the client side name of the file or if
you want the user to think that he loads directly from an URL...

Do you use http://support.microsoft.com/kb/260519/en-us ? (note the filename
part that allows to tell which name you want client side)

Else you could handle the 404 error and use Server.Transfer to go to the
RequestFile.asp with the proper filename as a parameter. Client side the
user will think he's loading directly from an URL...

--

"Tomas PAJER" <TomasPAJER@discussions.microsoft.com> a écrit dans le message
de news:A63AA81C-25CF-41E7-89C8-DA5C04928558@microsoft.com...
> I have many office files saved in sql server. The system sends them by one
> web page: RequestFile.asp. So every file has the same name

requestFile.asp.
>
> How can i change requested URL on the server from
> www.domain.com/requestFile.asp to www.domain.com/someFileName.doc????
>
> I am able to rise "Save or open downloaded file" dialog, but this does

not
> help me at all.
>
> Thank you very much.
>
> Tom



Tomas PAJER

2005-11-28, 7:55 am

Hello Patrice.

I have read that kb article, but it cannot be used. Yes, I can set the name
of the file in Response.AddHeader "content-disposition","attachment;
filename=fname.ext" header, but if the user wants to open the file, it is not
possible. There is no file In temporary internet files folder with that name.
It is still saved with the name derived from the url.

I think that the only option is to map the 404 error page to
requestFile.aspx and use Server.Transfer method. Thank you very much for that
good idea.

Tom






"Patrice" wrote:

> Not sure if this is a problem with the client side name of the file or if
> you want the user to think that he loads directly from an URL...
>
> Do you use http://support.microsoft.com/kb/260519/en-us ? (note the filename
> part that allows to tell which name you want client side)
>
> Else you could handle the 404 error and use Server.Transfer to go to the
> RequestFile.asp with the proper filename as a parameter. Client side the
> user will think he's loading directly from an URL...
>
> --
>
> "Tomas PAJER" <TomasPAJER@discussions.microsoft.com> a écrit dans le message
> de news:A63AA81C-25CF-41E7-89C8-DA5C04928558@microsoft.com...
> requestFile.asp.
> not
>
>
>

Patrice

2005-11-28, 7:55 am

Which browser ? This is not he behavior I have with IE6. It may append a
suffix such as [1] but it uses the filename correctly. Try perhaps to
enclose the name within ". Should work...

--
Patrice

"Tomas PAJER" <TomasPAJER@discussions.microsoft.com> a écrit dans le message
de news:60BF48D0-C951-4E23-BF02-05743A0C8F1B@microsoft.com...
> Hello Patrice.
>
> I have read that kb article, but it cannot be used. Yes, I can set the

name
> of the file in Response.AddHeader "content-disposition","attachment;
> filename=fname.ext" header, but if the user wants to open the file, it is

not
> possible. There is no file In temporary internet files folder with that

name.
> It is still saved with the name derived from the url.
>
> I think that the only option is to map the 404 error page to
> requestFile.aspx and use Server.Transfer method. Thank you very much for

that[color=darkred]
> good idea.
>
> Tom
>
>
>
>
>
>
> "Patrice" wrote:
>
if[color=darkred]
filename[color=darkred]
message[color=darkred]
one[color=darkred]
does[color=darkred]


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com