Solved

create and download file

Posted on 2013-05-17
5
372 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 75

Expert Comment

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

Accepted Solution

by:
Mrunal earned 350 total points
ID: 39175855
0
 
LVL 1

Author Comment

by:rafaelrgl
ID: 39175951
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
ID: 39176725
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
ID: 39177807
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

623 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