C# - How To Write The Code For Self Expiring Download Link For Website
Jul 19, 2010
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?
View 2 Replies
Similar Messages:
Mar 17, 2011
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.
View 2 Replies
Feb 10, 2011
I have web page, in that I place some links(hyperlinks or linkbuttons).
each button, when user clicks then a file should be downloaded to the user system..
files that are to be downloaded exists in asp.net website project folder>>downloads folder.
View 1 Replies
May 10, 2010
I have a panel which displays data on selected criteris with the followin columns Confirmationnumber fromdate todate propertynumber now the data which is in the confirmation number is a hyperlink which when clicked should be directed to the page with that particular confirmation number and similarly the property number is a hyperlink which should be directed to that property number page when clicked I dont know how to give the link to it
[code]...
<td><a href="/?ID=Booking.View&BookingID=<%#Eval("ReservationID")%>"><%#Eval("BookingConfirmationCode")%></a></td>
The above code is working so how I present this bold line in the above criteria
View 49 Replies
Feb 16, 2010
I watched old videos that suggest to test the asp.net website load using Microsoft Web Application Stress Tool. But there is a broken link to get the download. tool to test website performance?
View 2 Replies
Mar 2, 2011
I want to create a download link for my Windows Forms application. I know you can do that using ClickOnce but I don't want a ClickOnce app so a added a setup project to my application that I just got to work the way I want so now I want to make it downloadable from my website. Should a I a web service or a WCF Service to do this or something else and what else should I do?
View 4 Replies
Mar 20, 2010
here's the code so far:
[Code]....
[Code]....
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........
View 7 Replies
Aug 19, 2010
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.
View 3 Replies
Dec 10, 2010
i m creating asp.net Mobile website page to download symbian .sis file to mobile ,but its not geting download properly.its working perfectly on desktop.
View 2 Replies
Mar 11, 2010
I am a newbie of handling memory.
in my web apps, files are stored as varbinary in sql server.
my goal is to make a response to let users to download the files.
if there is a file (500 MB) stored in one record in the sql server,
what is the best way to let users download it?
I found that , in code-behind, if the files are loaded as byte[] objects, it uses the memory.
for example, the datalength of a file in the database is 500 MB.
the byte[] for this file uses 500 MB memory. am I correct?
how about the filestream? if the file is loaded as a filestream object in code-behind.s
does it also take 500 MB memory?
View 2 Replies
Oct 9, 2010
I want people to download files, EXE & DOCs from my website but I want to track the download, therefore I don't want them to now the real url so they won't be able to go there directly to download
View 16 Replies
Oct 18, 2010
I have a web application which consists of many aspx pages ... one of them shows a grid with rows that can be exported to a file via button click. This works fine. Now I want to have that feature which allows a user to access an external link to this page (or another) and to export to a file and download. I dont need any information on the page, just the file download. How could I do this also including security features like encryption?
View 2 Replies
Mar 9, 2010
I am trying to download MVC framework but it doesn't work.
View 4 Replies
Aug 18, 2010
I have a few linkbuttons that each open the save dialog to let users save file to the local machine. But after any link is clicked the page is dead afterwards (nothing works) and page has to be refreshed.
So do I have to force refresh after download is complete or does it have to do something with postback?
{
StringCollection strValuesToSearch = new StringCollection();
strValuesToSearch.Add("findword");
string stringToReplace;
stringToReplace = TextBox1.Text;
[Code]....
View 1 Replies
Apr 5, 2010
I have an asp.net that produces a Word document. I want to allow users to download the file to their local drive. I use a hyperlink to achieve this and it works fine from my development site. However, when the website is accessed from a non development machine, I am sent to the proper directory, but instead of the open/save/cancel dialog I am presented with a "Convert File" dialog. Any of the selected file types I select download unusable files. I think this has to do with office being installed on the local machine on which I am attempting the download. Is there any way I can simply download a file from a virtual file to my local drive?
View 2 Replies
Sep 22, 2010
I have two types of downloads at our site. One is from our server and rendered using server side code, which I record the number of downloads whenever the code is executed. Another is from our parterner's site and offerred with a regular html link, like
<a href="http://www.partnersite.com/download/filename.zip>download</a>. How can I count the number of downloads for this link?
View 2 Replies
Apr 7, 2010
I am able to upload a file to the server into a folder structure. but when I try to link to the file, the image path in the code is giving a strange url.
It should be something like
<a id="GridView1_ctl02_HyperLink1"
href="../MyFiles/1.jpg">HyperLink</a>
but instead its coming back as
<a id="GridView1_ctl02_HyperLink1"
href="../MyFiles/%3C%25#%20Eval(%22filename%22)%20%25%3E">HyperLink</a>
I am using this code to link to the button - which I'm sure is causing the problem
<asp:HyperLink
ID="HyperLink1"
NavigateUrl='~/MyFiles/<%# Eval("filename") %>'
runat="server">HyperLink</asp:HyperLink>
View 2 Replies
Jun 24, 2010
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?
View 3 Replies
Dec 17, 2010
I'm trying to create a ZIP file on the fly which might contain a few thousands of pictures.
[code]....
My question:
Is there a way to initiate the download (let the download manager on client side popup), and then start writing on the stream?
I monitored w3wp.exe (IIS) process, and it seems that the data is being written on memory instead of Stream.
When w3wp.exe memory usage riches a certain number, it releases the memory and nothing happens (no download).
View 2 Replies
Mar 10, 2010
I am a newbie of asp.net.
The environment is .net 3.5 and C#.
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.
View 4 Replies
Aug 25, 2010
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.
View 1 Replies
May 10, 2010
I want to download images from third-party server. for that third-party provide url link for each page.
samples are provideded below.
[URL]
when click on each link it will give an image in browser window.
i want to store each image automatic in server.
View 1 Replies
Jan 13, 2011
I'm usign the following funtion to download a file from griview link button.
This code works fine without the Update Panel in the form.
If i put grid inside the updatepanel, i can't download the file. shows System.WebForms Cannot parse file.
//protected void LnkDownload_Click(object sender, EventArgs e)
//{
// LinkButton Lnk = sender as LinkButton;
// string filepath = Server.MapPath(Lnk.CommandArgument.ToString());
// System.IO.FileInfo myfile = new System.IO.FileInfo(filepath);
// if (myfile.Exists)
// {
// Response.ClearContent();
// Response.AddHeader("Content-Disposition", "attachment; filename=" + myfile.Name);
// Response.AddHeader("Content-Length", myfile.Length.ToString());
// Response.ContentType = "application//octet-stream";
// Response.TransmitFile(myfile.FullName);
// Response.End();
// }
//}
View 5 Replies
Apr 27, 2010
i have stored the txtfile in the database.i need to show the txtfile when i clik the link. and this link has to be created dynamically.
my code below:
aspx code:
[code]....
i have got the link dynamically, but i did not able to download the txtfile when i clik the link. how to carry out this.
View 2 Replies
Jun 21, 2010
I have created a role based menu for my asp.net 3.5(C#) by configuring Asp.Net Membership module for site. My role based menu is a nested HTML unordered list. And each list item has a list of links. And at the end a list item has SignOut link. I have created 5 role groups for my website and put this list(i.e. menu) inside the contentTemplate of each and every role group.
I have display the SignOut link by using LoginStatus but I dun want to put the Login Status in each and every Roles Group. Can anybody tell me how to create a generic view which will display the Signout link when any user is logged-in. But I dun want to show the SignIn link when the user is not logged-in.
View 2 Replies