Solved

create and download file

Posted on 2013-05-17
5
300 Views
Last Modified: 2013-05-25
hi, i have a page that i want when the user click on one button executes this function:

   Private Function CreateImg(ByVal sImage As String,) As System.Drawing.Bitmap

i want when the click happens execute this function and download the image file that is created to the computer of the user asking where the user want to be save.
0
Comment
Question by:rafaelrgl
5 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
What is your question?
0
 
LVL 22

Accepted Solution

by:
Mrunal earned 350 total points
Comment Utility
0
 
LVL 1

Author Comment

by:rafaelrgl
Comment Utility
this works for an file on the server:

String FileName = "FileName.txt";
String FilePath = "C:/...."; //Replace this
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.ClearContent();
response.Clear();
response.ContentType = "text/plain";
response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ";");
response.TransmitFile(FilePath);
response.Flush();
response.End();

what i want is to use the function i mention above that returns an bitmap, convert to file and downloaded. this function downloads an file on the server using path, but i don't have that, i have the function that returns an bitmap.
0
 
LVL 10

Assisted Solution

by:Monica P
Monica P earned 150 total points
Comment Utility
Hi

Sorry i cannot clearly understood your request

check whether this sample meet your need

http://forums.asp.net/t/631768.aspx/
0
 
LVL 1

Author Comment

by:rafaelrgl
Comment Utility
i think i was not clear about what's the question, so let me try to explain, i have an webpage that on codebehind i have this function:

  Private Function CreateImg(ByVal sImage As String,) As System.Drawing.Bitmap

but it returns system.drawing.bitmap. what i want is to convert this into a file and download it to the user when the user clicks on a button, lets say:

'get the bitmap
createimg("ldfk")
download the image created to the user in jpg format
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now