|
Hi all.
So here is my problem. The application is hosted in Windows Server 2008 with IIS7.
I have a button (from Silverlight page) that calls a new webpage (asp.net page, ext .aspx) that contains Response.OutputStream.Write(blahblahblah) which then should prompt a download box to allow user to save an image.
Now the page basically creates a stream and then is supposed to output the stream to the user using Response.Outputstream.Write.
Then the user is supposed to be prompted to open or save the document. This works fine in Firefox but it does not work with IE7 or 8
Also this exact same code works with IIS6 on a Windows 2003 server.
So the only differences is the IIS6 and Windows 2003 Server to IIS7 and Windows 2008 Server.
And what happens is when I clicked the button, the page did pop up but disappear 1-2 seconds later without prompting the download box to the user.
Here is the code that launches for Reference
//e.g file = 123424_43535.jpeg
FileInfo myFile = new FileInfo(Server.MapPath("mapImage/") + file;
using(var fs = myFile.Open(FileMode.Open, FileAccess.Read))
{
byte[] buffer;
int read;
buffer = new byte[(int)fs.Length];
Response.AddHeader("Content-Disposition", "attachment;filename=" + file);
Response.ContentType = "application/x-force-download";
Response.AddHeader("Connection", "Keep-Alive");
Response.AddHeader("Content-Length", fs.Length.ToString());
while((read = fs.Read(buffer, 0, buffer.Length)) > 0)
{
this.Response.OutputStream.Write(buffer, 0, read);
}
}
Response.End();
I have tried to replace Response.AddHeader with Response.AppendHeader, however the result is still the same.
Also, I have tried to replace the Response.ContentType with application/octet-stream and image/jpeg, I also faced the same result.
Is there any setting/modification on server/code that I need to look on?
This problem has bugged me for a long period and a quick reply/solution will be very much appreciated.
Thanks and have a nice day.
Regards,
Kent
|
|
|
|
|
Hi,
In my gridview i have added the following field to view (summary) of a particular order number.
<asp:buttonfield buttontype="Link" runat="server" text="View" commandname="View">
The summary is displayed in the same page. I have used rowcommand event of gridview for the control.
My code works well but i want to change the text of control from view to *view once it is clicked so that one recognizes the order that is being viewed.
I tried searching but am not sure as wat to search. Please provide guidence in this regards.
Thankyou
|
|
|
|
|
hello
I want to upload specific file on the disk thus I try to set the File textbox field without having to click on the browse button but I have failed I use this line
so I create another textbox
and button to upload the file from textbox
this attempt create file in the uploadfolder its name is test but empty file
so any Ideas
thanks in advance
|
|
|
|
|
how can I create custom dropdownlist ( inherited from standard dropdownlist) with 4 default items?
I can inherit from dropdownlist but I dont know how I can add this items
|
|
|
|
|
mohandesmehran wrote: how can I create custom dropdownlist ( inherited from standard dropdownlist) with 4 default items?
You want to create a custom drop downlist only to have 4 default items?
Well, add the items in the constructor of the inherted class.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
|
I need a person that will interstingly join me in my quest to develop www.runningcodes.net and making it a dream come true. as at now my major challenge is the connectionstring. i am using aspnetdb.mdf as for my site.http://www.codeproject.com/script/Forums/Images/smiley_confused.gif
|
|
|
|
|
Basically what are u trying to do ?
why anyone will help you in your task ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Sandeep Akhare wrote: why anyone will help you in your task ?
Because he is
|
|
|
|
|
Abdulhafeezo wrote: I need a person that will interstingly join me in my quest to develop www.runningcodes.net and making it a dream come true.
Well, you can find a lot of them at http://www.rentacoder.com/[^].
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I'll help you for sure. Where shall I send details of my hourly rate?
|
|
|
|
|
Hi
One of my project i need a generic parser. The requirement is as follows
1. Should be a Fast forward only parsing
2. Child Nodes of a given nodes need to be parsed. (Different XML formats are supported)
eg : Root1\Root2\Root
Child1\Child2\Child
3. Traversing through each Sub nodes in selected Child nodes
and store value into database
My Question is XPath supported in Fast Forward only parsing. i would to know about the best ways to solve this issue with a better performance.
Cheers
|
|
|
|
|
|
|
|
Hey! Cud some1 please advice me, because i am intending using tab control for the whole of my web site. Since it does not require total refreshing of the site at all.
|
|
|
|
|
|
Abdulhafeezo wrote: ecause i am intending using tab control for the whole of my web site
You can use AJAX Tab Panel !
|
|
|
|
|
will u like to help me in building my website www.runningcodes.net
|
|
|
|
|
what kind of help you are expecting from me?
|
|
|
|
|
i will like u to help me make it possible for a forum to be on the site. can u help?
|
|
|
|
|
Abdulhafeezo wrote: i will like u to help me make it possible for a forum to be on the site. can u help?
Please let us know what is your actual problem.
|
|
|
|
|
Hi , ive got a asp.net vb web app, now i save a color code the a sql database and the show the data in a c1webgrid, now what i want to do is put a panel in template column and set the backcolor of the panel acording to what is in the database
Now what i did was
<C1WebGrid:C1TemplateColumn>
<ItemTemplate>
<asp:Panel ID="Panel4" runat="server"
BackColor='<%# Eval("ColorCode") %>' Height="20px" Width="20px>
<asp:Panel>
</ItemTemplate>
</C1WebGrid:C1TemplateColumn>
but it gives me a System.InvalidCastException: Specified cast is not valid error
if someone can please help me with this,
Thanks
|
|
|
|
|
Try Eval("ColorCode").ToString()?
|
|
|
|