Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Rename File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shapper - 18 Dec 2007 02:07 GMT
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
Michael Nemtsev [MVP] - 18 Dec 2007 09:28 GMT
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

s> Hello,
s>
s> I want to make a file available to a user for download on an ASP.NET
s> page.
s> So I need to have a button that when clicked, the file is download.
s> However, before the file is downloaded, I want it to be renamed so
s> the
s> file name that the users gets is different that the one in the
s> server.
s> The extension will be the same.
s> Any idea of how to do this?
s>
s> Thanks,
s> Migue
George Ter-Saakov - 19 Dec 2007 13:53 GMT
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

> Hello,
>
[quoted text clipped - 9 lines]
> Thanks,
> Miguel

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.