By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,742 Members | 2,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,742 IT Pros & Developers. It's quick & easy.

Rename File

P: n/a
Hello,

I want to make a file available to a user for download on an ASP.NET
page.
So I need to have a button that when clicked, the file is download.
However, before the file is downloaded, I want it to be renamed so the
file name that the users gets is different that the one in the server.
The extension will be the same.

Any idea of how to do this?

Thanks,
Miguel
Dec 18 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello shapper,

instead of putting direct link to file on webform, put the linkButton and
in the codebehind read your file as stream and send it to user
in this case u can send is with any name

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
sHello,
s>
sI want to make a file available to a user for download on an ASP.NET
spage.
sSo I need to have a button that when clicked, the file is download.
sHowever, before the file is downloaded, I want it to be renamed so
sthe
sfile name that the users gets is different that the one in the
sserver.
sThe extension will be the same.
sAny idea of how to do this?
s>
sThanks,
sMiguel
Dec 18 '07 #2

P: n/a
You will have to write your own aspx that streams file to the browser
and append following line to header
Content-disposition: attachment; filename=fname.ext
See http://support.microsoft.com/kb/260519
George

"shapper" <md*****@gmail.comwrote in message
news:ce**********************************@e10g2000 prf.googlegroups.com...
Hello,

I want to make a file available to a user for download on an ASP.NET
page.
So I need to have a button that when clicked, the file is download.
However, before the file is downloaded, I want it to be renamed so the
file name that the users gets is different that the one in the server.
The extension will be the same.

Any idea of how to do this?

Thanks,
Miguel

Dec 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.