C# - CPU Usage Goes Upto 75% While Stream A 300 MB File Using WCF Service?

Aug 31, 2010

I have a wcf service that is used to download files. Its working alright (finally), but i can see that when it downloads the CPU usage goes around 75%.Client Code

FileTransferServiceClient obj = new FileTransferServiceClient();
Byte[] buffer = new Byte[16 * 1024];
CoverScanZipRequest req = new CoverScanZipRequest(

[code]...

View 1 Replies


Similar Messages:

Save A File / Stream To Local Folder From Response Output Stream?

Feb 22, 2011

I have an excel file in my Response Output stream. I can Open the stream as a file after a prompt, but it doesn't seem I can save it directly to a specified folder on my client.

View 1 Replies

How To Read XML File Using System.IO.Stream With LINQ / Cannot Convert From 'System.IO.Stream' To 'string'

Jul 19, 2010

i will be passing the xml file like this:

[code]....

error:

Error 1 The best overloaded method match for 'System.Xml.Linq.XDocument.Load(string)' has some invalid arguments

cannot convert from 'System.IO.Stream' to 'string'

View 2 Replies

Can Stream A File In C#

Dec 20, 2010

Assume we have the access to sth.avi on [URL] with a direct link.

e.g : [URL] Also we have a website => www.dl2.com.

Now, we wanna let some users to download sth.avi from [URL], but we don't have enough space on [URL] to save sth.avi. Is it possible in ASP.NET for us to read sth.avi from www.dl.com as streaming file and share it without saving the file on our domain.

P.S: I don't wanna share this link [URL], actually I wanna share something like this link [URL]

View 3 Replies

Convert Stream To Zip File

Aug 29, 2010

I have made a WCF web service that streams a 200 mb zip file. how i can read this stream at my client and then give option to the user to download that

View 1 Replies

Get Dynamic Data From Log File To Track The Site Usage?

Oct 27, 2010

How can I track the users who visit the site using Log file. I want to automate the same. We have deployed around 10 websites on the web server which include .net and Flex applications. I want to make the report of site usage. Would it be possible to do the same using log files?

View 7 Replies

C# - Create Zip File From Stream And Download It?

Feb 15, 2010

I have a DataTable that i want to convert it to xml and then zip it, using DotNetZip. finally user can download it via Asp.Net webpage.

My code in below

dt.TableName = "Declaration";
MemoryStream stream = new MemoryStream();
dt.WriteXml(stream);
ZipFile zipFile = new ZipFile();
zipFile.AddEntry("Report.xml", "", stream);
Response.ClearContent();
Response.ClearHeaders();
Response.AppendHeader("content-disposition", "attachment; filename=Report.zip");
zipFile.Save(Response.OutputStream);
//Response.Write(zipstream);
zipFile.Dispose();

the xml file in zip file is empty.

View 6 Replies

HttpHandlers / Modules :: WAV Stream To File?

Mar 16, 2010

I have a url that points directly to a wav file. Id like to extract the file from the url and save it to a file on our file system.

View 2 Replies

File Stream Path On Hosted Server

Mar 19, 2011

I am trying to filestream to my hosting Companies sever.I have tried the below expecting it would not work. How can I find the correct path.Could not find a part of the path 'C:ERAPDFERA202.60.64.136.1.pdf'.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:ERAPDFERA202.60.64.136.1.pdf'.

Source Error:
[Code]....

View 2 Replies

Web Forms :: Cannot Stream File To Desktop From Pop Up Window

Sep 23, 2010

I changed an app so one of the edit screens opens as a pop-up window via showModalDialog. Previously everything was done in the same window and more back and forth navigation was required. The pop-up provides greater continuity. Unfortunately, as a pop-up, files will not stream to the desktop. If I bring up the page by entering a URL on the address line, so it is not a pop-up, files stream to the desktop OK.

Streaming a file to the desktop is done as follows:

[Code]....

This causes an open/save/cancel dialog to appear in the browser. Does anyone have an idea why a file cannot be streamed to a pop-up window? To get pop-ups to work I always include

[Code]....

in the header. That way I can open other pop-ups such as warnings and database error messages from a prvious pop-up.

View 1 Replies

Web Forms :: Stream A File And Update Page?

Jul 28, 2010

I don't think there is a way around this but figured I'd ask... We have an application where a user can generate PDF documents that are streamed to the browser. There is some additional functionality going on behind the scene and I would like to be able to display a message to the user (via updating a literal tag on the page). I don't get any errors when doing this but the page isn't updated and the message isn't displayed. My guess is that streaming the document blocks any other content from going down to the client. In particular, we're using CeTe Dynamic PDF and calling one of their methods but I think it's essentially just doing a Response.BinaryWrite to stream out the PDF.

View 6 Replies

Firefox Sporadically Displays File Stream Instead Of A Document?

Feb 22, 2010

When user requests to download a document, I'm writing out a PDF file to HttpResponse using HttpResponse.OutputStream.Write method. It works in every browser except Firefox(3.5.8). In Firefox it sometimes displays the file and sometimes it displays the actual byte stream. When it displays a byte stream, http response is never finished. I see 'transferring data' status and the byte stream ends with EOF. After some time, I get 'connection was reset' window.

Here is response header:

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 103185
Content-Type: application/pdf
Expires: -1
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
Content-Description: stuff.pdf
Content-Disposition: inline;filename="stuff.pdf"
X-Powered-By: ASP.NET
Date: Mon, 22 Feb 2010 16:15:38 GMT

View 5 Replies

Stream File To Chome Broken, Firefox Working?

Jan 22, 2011

I wrote an ASP.Net web page that will take a QueryString and stream a file to the client. The file is stored in a SQL Server database. Everything works great when I'm running the web site locally during development. When I run it in production from the server I can get a file through Firefox, but not Chrome. In Chrome I get Error 100 (net::ERR_CONNECTION_CLOSED): Unknown error.See some other posts that mention this could be related to Content-Length, however, I can't understand why this would work in development and not production. For that reason I think there must be something else going on here.Here is my code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Data_ID As String = Request.QueryString("Data_ID")
Using dt As New Enterprise_Error_Log.Field_FileDataTable

[code]...

View 1 Replies

Web Forms :: Reading A File Into Stream And Saving It To A Location?

Oct 8, 2010

I have a third party CMS system that can create forms but can't manage true File upload capabities. I am able to get users brows for thier file and have the value submited to my custom .net code behind page for processing. So I end up with like "C:somefilefoldersomefile.doc".

But on my processing page I want to read this file (like the file uploader) and save it to a location. I tried using the file uploader control (but have it not visible) but realized I can't preset it as I was planning to set it and do the normal processing from there. Is there another way to do this?

View 3 Replies

Web Forms :: Send A Large File To The Response Stream - OutofMemory?

May 20, 2010

I'm using Filestream for read big file (> 500 MB) and I get the OutOfMemoryException. Any solutions about it?? I want this in my app asp.net: Read DATA from Oracle Uncompress file using FileStream and BZip2 Read file uncompressed and send it to asp.net page for download. When I read file from disk, Fails !!! and get OutOfMemory. My Code is:

using (var fs3 = new FileStream(filePath2, FileMode.Open, FileAccess.Read))
{
byte[] b2 = ReadFully(fs3, 1024);
}
// [URL]
public static byte[] ReadFully(Stream stream, int initialLength)
{
// If we've been passed an unhelpful initial length, just
// use 32K.
if (initialLength < 1)
{
initialLength = 32768;
}
byte[] buffer = new byte[initialLength];
int read = 0;
int chunk;
while ((chunk = stream.Read(buffer, read, buffer.Length - read)) > 0)
{
read += chunk;
// If we've reached the end of our buffer, check to see if there's
// any more information
if (read == buffer.Length)
{
int nextByte = stream.ReadByte();
// End of stream? If so, we're done
if (nextByte == -1)............................

View 8 Replies

HttpHandlers / Modules :: Write The Response Stream Content To A File On Disk

Jan 20, 2011

I have an httpmodule and it has a handler for OnEndRequest. I am trying to write the HttpContext.Response.OutputStream to a file. I am trying to use the Read method of it. But when it is called the exception message i get is "Specified method is not supported". So i am not able to do what i want that is, write the response to a file on the disk. I am able to write the HttpContext.Request.InputStream to a file using its Read method which i do in a handler for OnBeginRequest.

View 2 Replies

Jquery - How To Write A File To The Response Stream And Have A 'Working' Modal Window Show/hide

Feb 15, 2011

I need to to export a file to the user. It takes 1-2 min to generate the file so I'd like to have the page go into a kind-of modal mode with a layover on the page and a 'Working' spinner showing. The problem is I can't make the modal stuff go away after Save File dialog is closed.

How can I remove the layover after the dialog is done?

View 1 Replies

Architecture :: Passing Exceptions Values Upto The UI

Nov 25, 2010

Most of my DAL functions use structures to pass the data back to the BLL and to the UI. I have got the try catch code now and it all works fine. I capture the exceptions in a seperate db table and it all works fine.I wanted to know how to pass the error up and what varable would be used to hold the error statusWhat I was think was - if I had a BO structure that was used to in the DAL and was populated and I wanted the error state up do I need to have a specific error field in the structure.

View 2 Replies

Web Forms :: Send Upto 360 Mails After That It Is Not Sending Emails?

Jan 30, 2010

I have a requirement of sending 3000 Emails one by one with an attachment of around 100KB, I was using System.net.mail namespace with our company mail server.my program will send upto 360 mails after that it is not sending emails,and it is not giving any exception.what is the solution to my problem.

View 13 Replies

Web Forms :: Script In Vb For Uploading Large Files Upto 1 Gb With Ftp

Apr 14, 2010

Iam looking a solution for uploading files with ftp. i need a asp.net script in vb for uploading large files upto 1 gb with ftp.

View 3 Replies

Web Forms :: Limit Decimal Upto 2 Instead Of 4 In Money Datatype?

Jan 4, 2010

i am working on a product based website in which i have a product table with product names and prices, i have defined the datatype of price as "Money"

but the problem is it shows price upto 4 decimals everytime, how i can limit that upto 2 decimals only, on the webpage as well as in the table also in database ?

View 8 Replies

Web Forms :: Upload Files Upto 100mb Into The Database?

Feb 10, 2010

I am creating an application where the user can upload files upto 100mb into the database and retrieve them later. I used the asp.net uploald control. Looks like it can upload only files of size 4MB.

View 3 Replies

Web Forms :: How To Allow Users To Enter Only Numbers And Values Only Upto 100

Dec 26, 2011

User will be entering % data in textbox. I am now using filter textbox extender to allow only numbers and .(ie decimal values). I also want the user to enter values from say 1 to 100 only.. How can i do this? If user wants to enter 0.5%?

View 1 Replies

How To Stream An Excel 2007 Or Word 2007 File Using C#

Mar 25, 2010

I'm working on a web app and need to stream various files. I can do pdfs, images, and older Office documents. However, when I try to do with 2007 documents, it breaks. Here is my code:

Response.Buffer = true;
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
switch (FileExtension.ToLower())
{
case "pdf":
Response.ContentType = "application/pdf";
break;
case "doc":
Response.ContentType = "application/msword";
break;
case "docx":
Response.ContentType = "application/vnd.ms-word.document.12";
break;
case "xls":
Response.ContentType = "application/vnd.ms-excel";
break;
case "xlsx":
Response.ContentType = "application/vnd.ms-excel.12";
break;
default:
Response.ContentType = "image/jpeg";
break;
}
Response.BinaryWrite(buffer);

The error that I get is:

An invalid character was found in text content. Error processing resource 'http://DomainName/GetFile.aspx.

View 2 Replies

Programmatically Adding Nested Repeater Controls Upto N - Levels?

Mar 23, 2010

I'm creating a navigation menu. I've to render repeater control ul-li tags and menuitems can range upto N levels. I need to add a child repeater control dymnamically to parent control?

EDIT:
Example -
ul-li can goto n levels
<ul>
<li>
<ul>
<li>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</li>
<li></li>
<li></li>
</ul>
</li>
<li></li>
<li></li>
</ul>

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved