Jump to content

Html File Download Tag In Jsp


Guest msp
 Share

Recommended Posts

The tag <input type="file" name="somefile"allows reading of a file into a form and will throw up a browser dependent input box that allows navigation on the local computer in order to findand select the file.My question is what is the converse of this? i.e. the same sort of interaction but selecting a location in whcih to save a file?I.e. is there a html or struts tag that be used in a jsp that will do this?Hope that makes sense.

Link to comment
Share on other sites

You can tell the browser that it should bring up the "Save As..." dialog window if you specify in your response the "content-disposition".In C#, it'd look like this for a PDF:

Response.Clear();Response.AppendHeader("content-disposition", "attachment; filename=myfile.pdf");Response.ContentType = "application/pdf";// Write out to the Response...Response.End();

http://www.google.com/search?q=content-dis...tion+attachment

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...