There are files stored in sql server (datatype of column is varbinary in the database).
each record is in one record in that table (FILE_TABLE).
And there is another table (PATH_TABLE) to store the files paths.
for example,
when the user download the folder A (select an item on the tree and click a button on the client side),
there is one sub-folder B and two files A-1 and A-2.
in folder B, there is two files B-1 and B-2.
then, at the code behind (server), the server will get the files from the database and convert them (including the files and subfolders) to a .zip file (or other compressed files)
and then write a response (using the method HttpResponse.BinaryWrite(Byte[] xxx) )
to client side and let the user download.
after the download, the user can extract the compressed file and the structure of the folders and files keep unchanged.
I am planning to sell digital goods on my website (Asp.net). After successful payment the customer will be redirected to the download page of my website, which will display the link to download the digital content stored in my server.
I want to secure the location of the file, by creating a disposable link to the file. Every time a customer visits this page a new download link will be generated for the same file. Also this link should expire after it is downloaded for the first time.
Is it possible to do it in asp.net ( C# preferably )? if yes how can i do it?
I have a web form, that needs to save the data that the user enters, into a file and on the client pc, that will also be able to read from the saved file and repopulate the fields at a later time. No files will be saved to the server side, so I expect streaming needs to be involved at writing time.
I decided XML would be an easy way to do this, but I'm stymied on methodology. XML documents? XML Writers?
I'm stumped on the right search terms to even get what I want.
I have some information I am pulling from my db into a table. Can anyone direct me to a tutorial that shows how to dynamically create a file and allow a user to download that file with the table contents. All this must be dynamic.
I am trying to change the text of a asp:textbox and collapse some ajaxToolkit:CollapsiblePanelExtenders within some ascx controls on my page as well as output a dynamically generated file. I have no problem collapsing the CollapsiblePanelExtenders and changing the text of the textbox from the codebehind or outputting a file. The problem arises when I want BOTH of these events to happen on the same postback. Unfortunately using Response.Write negates all of the other changes to the page.
I have a code which saves the control id and its text in database..(and it is working fine).This code is written in default.aspx.cs which will save all the controls(of deault.aspx) id and name in database.I want to make a class file and then call this class file in page rather than writing the code in page because there will be multiple pages where this can be called.write this function DisplyDetails() in class file..code is as below..
public partial class _Default : System.Web.UI.Page { string controlId, propertyValue,other; SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["abc"].ConnectionString); protected void Page_Load(object sender, EventArgs e)
i have store the file information like name and size in the datagrid not the content when i click the view button in the grid how to display file contents
mov is a quicktime file, my server has the mimetype: video/quicktime .......... but as I read, this code forces the save as download box which is exactly what i want :) now, here's the catch, i the file I am fetching is NOT on the physical path... it is on a completely different server:Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click Response.Clear() Response.ContentType = "x-msdownload" Response.AppendHeader("Content-Disposition", ("attachment; filename=mydownload.mov")) Response.TransmitFile("http://myOTHERserver.com/files/mydownload.mov") Response.End() End Sub
Obviously this doesn't work since TransmitFile requires that the file be on your physical path, so how do i do this? Someone said you must use the stream method. Do you have any sample code I could try? I've tried the HTTPStreamReader object but it's giving me issues, so I would love to find out if there is anyway this might work. Now here's some more important information: this are HUGE video files.. we are creating a downloads page... written in asp.net -- so you create an account using the .net membership class, then you select the file you want, go through a form where you enter your billing info and then after you pay a certain fee (this is already implemented), you go to your "downlaods" area in your account... there you have access to the files......... the reason i'm doing this is because i want to hide the download link, which will be something likehttp://myOTHERserver.com/2340987sdfkjhalsdlkjh23 ... (something really crazy)....... we don't want people seeing this on the status bar (Therefore hiding the download link is ESSENTIAL)........ the files are a good 500MB each approximately; so i would love to hear all of your suggestions as to making the streamreader work for me and how long would it take for the streamreader to READ the file........
Is there a way I can code some vb whereby the server would download a file from a given URL from an external website elsewhere? For example, if I entered the url for the 7-Zip exe, it would then download that from SourceForge of wherever, and save it to the server.
If Not IsDBNull(ext) Then ext = LCase(ext) End If Select Case ext 'Case ".htm", ".html" ' type = "text/HTML" 'Case ".txt" ' type = "text/plain" 'Case ".doc", ".rtf" ' type = "Application/msword" 'Case ".csv", ".xls" ' type = "Application/x-msexcel"........................
I am downloading file from database using the following code. This code downloads an excel file from the database which has a macro attached to it when it is opened. This macro reads file name of the excel file and uses it for its computation. Everthing works file if user saves the file on his harddisk and then open if but if he directly opens the file from the dialog(by hitting 'Open' button) then file name of the opened excel file comes out be the name of the webform that has the above code and this leads to error in the macro. Is there any option through which i can control the name of the file if user directly opens the file from dialog or the option to disable or remove 'Open' button form the dialog?
I'm about to submit my pad file to multiple sharware sites but the pad file has to have a direct link to the download file and can't link to a download page which is what I would like to do, so I can track the traffic and get the downloader's email before allowing the download. I am running an ASP.NET site in VB. Is there a way to tell the web app to redirect to a specific aspx page when it receives a request for a specific file?
I want to create and write file in "C:windowssystem32" this path.some computer give the error access denied.i want some code in C# who give the permission to folder.
This block of code display Download file Dialog for Open or Save the attached file.It's working fine in Mozila Firefox and IE8 but doesn't display Download file Dialog box in IE 7
I have made an application where I am displaying the .pdf , .doc , .docx files. These files are uploading from an Admin Panel.When user place a mouse pointer on download icon provided in front of every file, it shows the complete path where it’s get saved.I want to avoid this path visibility even when user place mouse on download icon and even if it Inspect an element (as most modern browser will have this functionality).
I've a gridview which I am rendering to a html text writer and allowing clients to download as an excel spreadsheet using Response.Write. I'm using AJAX in my website now and suddenly it stopped working. This is the code I'm using
public static void Convert(DataSet ds, HttpResponse response) { try { //1. declare filename to export string filename = "export"; //2. clear response object response.Clear(); response.Charset = ""; //3. set response mime type to excel response.ContentType = "application/vnd.ms-excel"; //4. prompt user to download the file response.AppendHeader("content-disposition", "attachment; filename=" + filename + ".xls"); //5. create a string writer StringWriter stringWrite = new StringWriter(); //6. create html writer which uses the string writer HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); //7. instantiate a gridview GridView gv = new GridView(); //8. set gridview datasource to the dataset gv.DataSource = ds.Tables[0]; //9. bind gridview gv.DataBind(); //10. tell the gridview to render itself into htmltextwriter gv.RenderControl(htmlWrite); //11. output html response.Write(stringWrite.ToString()); //12. end response response.End(); } catch (Exception ex) { string str = ex.Message; } }
I've found that Response.Write doesn't work with AJAX. Are there any alternatives to this?