473,696 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response.Transm itFile - Windows Mobile 6.0

Hi,

I have use the following code to transmit a file back to the browser that
worked fine on a HTC_TTyN device running windows mobile 5.0. The code
executes in the onclick event of a mobilelist control. Now on a similar
device running window mobile 6.0 the file is not displayed - the link causes
a post back succesfully and the code appears to execute - on the browser a
bar is displayed breifely at the bottom of the window (although ist show 0KB
to the right of the bar.) - seaming to indciate that a file is being
transferred but the file save option (or the file) does not appear.

Does any one have any ideas why this is not working ? I suspect it may be
something that is specific to the HCT_TTyn devcie as we have identifed a
separate issue where the browser capabilities where not being detected
correctly - this was due to the fact that the useragent string was being
prefixed with 'HCT_TTyn ' - to work around this we have defined a new
htctty.browser file and registered it with asp.net which seams to have solved
all the problems we were having - apart from this file transfer issue.

protected bool SendFile(string filePath)
{
string fileName = System.IO.Path. GetFileName(fil ePath);
if ((fileName != "") && (System.IO.File .Exists(filePat h)))
{
try
{
Response.Clear( );
Response.ClearH eaders();
Response.ClearC ontent();
Response.Conten tType = "applicatio n/octet-stream";
Response.AddHea der("content-disposition", @"attachment ;
filename=""" + fileName + @"""");
Response.AddHea der("content-length", new
System.IO.FileI nfo(filePath).L ength.ToString( ));
Response.Transm itFile(filePath );
Response.Flush( );
Response.End();
Response.Close( );
return true;
}
catch
{
return false;
}
}
else
return false;
}

Nov 26 '07 #1
1 2859
Hi Woodgnome,

As for the file downloading issue you mentioned, I think your analysis is
reasonable. for mobile or smart device requests, the http useragent is the
default evidence of the device and ASP.NET runtime will probably respond
quite different due to it.

I think you can make some simple tests to verify the behavior. You can use
some .NET winform client application to send http request(with the
useragent set to the same value as your smart device), if the response (you
can view it through some network trace tool or directly get it through
network component such as HttpWebRequest) still give the same problem
result, the problem should be caused by the device's useragent. And for
such case, I think customize the server application's browser/device
detection setting should be the reasonable method.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>Thread-Topic: Response.Transm itFile - Windows Mobile 6.0
thread-index: AcgwM8zdaNC3/emhQ3OlyEuh+rCp gA==
X-WBNR-Posting-Host: 82.110.100.247
From: =?Utf-8?B?V29vZGdub21 l?= <wo*******@comm unity.nospam>
Subject: Response.Transm itFile - Windows Mobile 6.0
Date: Mon, 26 Nov 2007 05:54:01 -0800
>
Hi,

I have use the following code to transmit a file back to the browser that
worked fine on a HTC_TTyN device running windows mobile 5.0. The code
executes in the onclick event of a mobilelist control. Now on a similar
device running window mobile 6.0 the file is not displayed - the link
causes
>a post back succesfully and the code appears to execute - on the browser a
bar is displayed breifely at the bottom of the window (although ist show
0KB
>to the right of the bar.) - seaming to indciate that a file is being
transferred but the file save option (or the file) does not appear.

Does any one have any ideas why this is not working ? I suspect it may be
something that is specific to the HCT_TTyn devcie as we have identifed a
separate issue where the browser capabilities where not being detected
correctly - this was due to the fact that the useragent string was being
prefixed with 'HCT_TTyn ' - to work around this we have defined a new
htctty.brows er file and registered it with asp.net which seams to have
solved
>all the problems we were having - apart from this file transfer issue.

protected bool SendFile(string filePath)
{
string fileName = System.IO.Path. GetFileName(fil ePath);
if ((fileName != "") && (System.IO.File .Exists(filePat h)))
{
try
{
Response.Clear( );
Response.ClearH eaders();
Response.ClearC ontent();
Response.Conten tType = "applicatio n/octet-stream";
Response.AddHea der("content-disposition",
@"attachment ;
>filename=""" + fileName + @"""");
Response.AddHea der("content-length", new
System.IO.File Info(filePath). Length.ToString ());
Response.Transm itFile(filePath );
Response.Flush( );
Response.End();
Response.Close( );
return true;
}
catch
{
return false;
}
}
else
return false;
}

Nov 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
7530
by: jeffpriz | last post by:
I'm have a situation where I need to put a download link/button on a page, where the file to be downloaded does not exist on our webservers .... So I'm using Response.WriteFile (i've also tried Response.TransmitFile) to put the file into the response.. My trouble is with a Zip file.. The user gets propmpted to Open or Save etc.. If they clicks save, the file saves just fine.. no problem... If they click Open, their Zip program will open,...
1
2239
by: Oct | last post by:
I have implemented an ISAPI filter to authenticate user download based on SQL data. It works great for all high speed users but it fail after 20-30 mins download on modem (yes, 56k!) user. The error message on the client side is "The connection with the server has been reset". I have tried increasing Server.ScriptTimeout to 2 hours also Session timeout to very long. I've set this on both the site property and explicitly run time. It...
0
1420
by: Thomas Andersson | last post by:
Hi, I have a problem with Response.TransmitFile. The server reset the connection after approx. 20 minutes and sometimes after 7-8 minutes when i try to download large files (400MB +) with Response.TransmitFile. What can be the problem? I have tried to use httpRuntime executionTimeout="14400"
1
3905
by: Ryan Pedersen | last post by:
I have been trying to figure out how to transmit a file back to a user using the response.transmitfile or response.writefile method and just not having much success. I have a dell server running windows 2003 web server edition fully patched. The files are physically on the same web server. The entire site is HTTPS... it has to be because it is a financial site. With SSL on I cannot get TransmitFile or WriteFile to work (all files are less...
0
1570
by: Ryan Pedersen | last post by:
I have a HttpHandler configured to use Response.TransmitFile. It is working error free when the server is in HTTP mode. In HTTPS mode it apears to work but after a users selects the location to save the file it open up the windows dialog for download progress and just sits there. It doesn't actually send the file. --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt...
3
6353
by: Buddy Ackerman | last post by:
I'm trying to write files directly to the client so that it forces the client to open the Save As dialog box rather than display the file. On some occasions the files are very large (100MB+). On these files teh time that it takes until the client displays the Save As dialog can be extrordinarily long (3+ minutes). I don't understand why. I was initiall using the format: Respnse.writefile("filepath", offset, length) but that simply...
2
6566
by: mgalvez | last post by:
I'm developing an interface that sends a file to the client. it works but the client also gets an "Action canceled" page (IE) how can I remove this page? or display the application home page? thank you! the conde is in the Page_Load sub: Response.Clear() Response.AddHeader("Content-Length",
1
1388
by: APA | last post by:
I am transmitting files using response.transmitfile. I only have a problem using it with MP3s. Larger files (20MB+ ZIP files) are no problem. I'm using an HttpHandler in .NET 1.1 on Windows 2003 to handle the delivery of MP3 files as well as ZIP files the zip files have no problem but the with MP3s I get an error on the client saying "the server reset the connection" (both IE and FF get the error) . I tested it on Windows 2000 and...
2
3184
by: Michael D. Ober | last post by:
When I single step through the code below, it sends back the PDF file that is retrieved in the line fm.GetAccountPDF(...). When I run without single stepping, I get the master page for this page. I have actually saved the file returned by IE 7 as a text file and opened it in notepad, so I have confirmed that it is indeed the page master being returned. The code is in the code behind file for the aspx page and is called directly from a...
0
8656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8590
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9005
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8845
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7693
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5848
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3025
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2304
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.