Click here to Skip to main content
15,898,371 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Image capture in .net Pin
aransiola13-Apr-07 8:30
aransiola13-Apr-07 8:30 
Questionhow to get value in the textbox Pin
Kissy1612-Apr-07 21:17
Kissy1612-Apr-07 21:17 
GeneralRe: how to get value in the textbox Pin
lucjon12-Apr-07 22:22
lucjon12-Apr-07 22:22 
GeneralRe: how to get value in the textbox Pin
Kissy1612-Apr-07 22:43
Kissy1612-Apr-07 22:43 
QuestionHow to cast HTTTPpostedFile in asp.net Pin
swapnilbhavsar12-Apr-07 21:11
swapnilbhavsar12-Apr-07 21:11 
AnswerRe: How to cast HTTTPpostedFile in asp.net Pin
Chetan Ranpariya12-Apr-07 23:57
Chetan Ranpariya12-Apr-07 23:57 
AnswerRe: How to cast HTTTPpostedFile in asp.net Pin
Vasudevan Deepak Kumar13-Apr-07 6:43
Vasudevan Deepak Kumar13-Apr-07 6:43 
QuestionDownloading a cab file without any chenge in content or size.. Pin
Nicejith12-Apr-07 21:10
Nicejith12-Apr-07 21:10 
Hi,

I have a web application(ASP.net, C#) in which the user is be able to download a .cab file to the PC by clicking on a button after making a file selection. I tried many methods for accomplishing the download task.

The code i tried is given below.


Response.ContentType = "APPLICATION/OCTET-STREAM";
System.String disHeader = "Download; Filename=\"" + myfilename+ "\"";
Response.AppendHeader("Content-Disposition", disHeader);
System.IO.FileInfo fileToDownload = new System.IO.FileInfo(myfilepath);
Response.Flush();
Response.WriteFile(fileToDownload.FullName);

or


FileStream MyFileStream = new FileStream(myfilepath, FileMode.Open);
long FileSize;
FileSize = MyFileStream.Length;
byte[] Buffer = new byte[(int)FileSize];
MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length);
MyFileStream.Close();
Response.ContentType = "application/octet-stream";
Response.AddHeader("content-disposition", "attachment; filename=" + myfilename);
Response.BinaryWrite(Buffer);


When i tried these two methods, i could download the files to the PC. The user has to copy the cab file to the Pocket PC device for installing it. The file downloaded through the web application may have some problem so that it cannot be installed on the Pocket PC.

When i tried to install the original file from the repository, it worked fine. It means that there occurs some problem with the cab file while it is being downloaded.

The original file is having the size 420 KB. But the file downloaded is having size 432 KB.

Could anybody guide me to solve the problem?

Thanks in advance.




Nicejith
AnswerRe: Downloading a cab file without any chenge in content or size.. Pin
lucjon12-Apr-07 23:21
lucjon12-Apr-07 23:21 
GeneralRe: Downloading a cab file without any chenge in content or size.. Pin
Nicejith13-Apr-07 1:36
Nicejith13-Apr-07 1:36 
QuestionASP.NET Ajax v1.0 Pin
DGtech12-Apr-07 20:55
DGtech12-Apr-07 20:55 
AnswerRe: ASP.NET Ajax v1.0 Pin
lucjon12-Apr-07 22:35
lucjon12-Apr-07 22:35 
Questionerror in sending email Pin
Sebastian T Xavier12-Apr-07 20:43
Sebastian T Xavier12-Apr-07 20:43 
AnswerRe: error in sending email Pin
Chetan Ranpariya12-Apr-07 20:54
Chetan Ranpariya12-Apr-07 20:54 
GeneralRe: error in sending email Pin
Sebastian T Xavier12-Apr-07 21:07
Sebastian T Xavier12-Apr-07 21:07 
QuestionHow to insert one datagrid in another datagrid Pin
Sophia Rekhi12-Apr-07 20:08
Sophia Rekhi12-Apr-07 20:08 
AnswerRe: How to insert one datagrid in another datagrid Pin
thomasa13-Apr-07 1:03
thomasa13-Apr-07 1:03 
QuestionPlease Help Me Soon Pin
Mkanchha12-Apr-07 19:10
Mkanchha12-Apr-07 19:10 
AnswerRe: Please Help Me Soon Pin
JustChiragPatel12-Apr-07 20:08
JustChiragPatel12-Apr-07 20:08 
GeneralRe: Please Help Me Soon Pin
Mkanchha12-Apr-07 20:20
Mkanchha12-Apr-07 20:20 
AnswerRe: Please Help Me Soon Pin
Chetan Ranpariya12-Apr-07 20:31
Chetan Ranpariya12-Apr-07 20:31 
GeneralRe: Please Help Me Soon Pin
Mkanchha12-Apr-07 20:38
Mkanchha12-Apr-07 20:38 
GeneralRe: Please Help Me Soon Pin
Mkanchha12-Apr-07 21:13
Mkanchha12-Apr-07 21:13 
GeneralRe: Please Help Me Soon Pin
Chetan Ranpariya12-Apr-07 22:42
Chetan Ranpariya12-Apr-07 22:42 
GeneralRe: Please Help Me Soon Pin
Mkanchha12-Apr-07 23:14
Mkanchha12-Apr-07 23:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.