Downloading File Process Causing Error?
Mar 11, 2010
In my ASP.Net page, I allow users to download files from the server. If the file is of even a moderate size (does it with a 40 meg file, for example), when downloading, it fails with the error message:
"Insufficient system resources exist to complete the requested service".
I've checked out the server, and it's quiet (CPU, RAM, Hard Drive, Task Manager Processes, etc all very low in their numbers).
I've run the code from several client machines and I'm getting this error message no matter where I run it from.
View 5 Replies
Similar Messages:
Mar 9, 2011
I have 4 checkboxes named(Laptop, Car, Phone, TV) and a button. when user checks one Car checkbox and clicks a button, car specifications pdf should be downloaded. Similarly when phone or laptop checkbox checked, relevant pdf's should be downloaded. For this i have written following code
[Code]....
This code is working well in VS2008 but has issues when run in localhost.
Issue --> Check one checkbox like chkPhone and click on button, the Phone pdf gets downloaded and uncheck chkPhone checkbox and check other one like chkCar and when clicked on button to download, getting following errors.
1. xml parsing error not well-formed --> this error is getting only in mozilla.
2. HTTP/1.1 100 Continue Server: Microsoft-IIS/5.1 Date: Wed, 09 Mar 2011 05:34:23 GMT X-Powered-By: ASP.NET HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Wed, 09 Mar 2011 05:34:23 GMT X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Content-disposition: attachment; filename=Car.pdf;
I have googled the issues and find the following sites[URL] For second issue i added the following line
System.Net.ServicePointManager.Expect100Continue = false;
but still sometimes iam getting the same error. Sometimes these errors raise after downloading 2 files and when tried to download 3rd one.
View 4 Replies
Jun 29, 2010
i got following error when downloading ZIP file having size 4GB the error says
The size parameter must be between zero and the maximum Int32 value.
Parameter name: size
Actual value was 2166897372.
View 2 Replies
Mar 8, 2010
I get the following error when downloading excel file in SSL site:
Internet Explorer cannot download xxxx.aspx from mysite.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
After googling, I suspect that it's the problem of the response header. I try the solution in this page and set the header:
[URL]
HttpContext.Current.Response.AddHeader("Pragma", "no-cache");
HttpContext.Current.Response.CacheControl = "private";
View 4 Replies
Mar 8, 2011
I have a large web application, which is supposed to run in a 64 bit process. However, when I set "Enable 32-bit Applications" to False on my App Pool, I get the following error trying to run the app in IE:
is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
The application name at he beginning of the error message is missing, i.e. I have not lost it during copy and paste.
I have been advised to use Process Monitor to determine which application/DLL load is actually causing the error, but I have no idea where to start with this.
EDIT: I have tried filtering Process Monitor on only w3wp.exe and only file system and process events, but simply attempting a navigate to the root URL yields 34,012 events.
View 2 Replies
Dec 24, 2010
I have Online Exam application when the user has completed his exam is write the question, answer and his result in the excel sheet and store it in server path. The admin has the option to reset the user ie the file gets deleted from the server. It works fine when Admin resets the file after some minutes but if Admin tries to reset the files in as soon as the exam is completed then i get the exception like "File Cannot be deleted since its used by another process" .
1. Will it work when i kill the Excel.exe in the server after the file completes the process or is there any optimul way to do the same.
View 1 Replies
Oct 24, 2010
I don't know why this does this on the delete.
line 289
The process cannot access the file 'D:InetPubReefJunkiesUsersillProfilePicture Thumb340x_la-rouxsmall.jpg' because it is being used by another process.
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.IOException: The process cannot access the file 'D:InetPubReefJunkiesUsersillProfilePicture Thumb340x_la-rouxsmall.jpg' because it is being used by another process.
Source Error:
[code]....
View 6 Replies
Jun 13, 2012
I have one gridview in that i have three columns "FileName" "Open" and "Delte" if user Opens clicks on open Pdf file opens in new window that time if user clicks on Delete Button then its giving Error that "Process is using by Some one" ...
View 1 Replies
Oct 11, 2010
I have a folder called GUI. Inside GUI thers another folder called PDF and inside this folder, there are some PDF files. This folder (GUI) is uploaded to the server too. Then I have a WebForm with some ImageButtons. When I click one of these ImageButtons, I want the file to open in a new tab. I tried with the following code:
[Code]....
As you can see, I build the path using the tooltips of the different ImageButtons. The ToolTip = File Name I want to open. When I try this in debug mode, it works. It opens the pdf file in a new tab. However when I publish my website and upload it to the server... it doesn't work... when I click an ImageButton I get the following exception: No application is associated with the specified file for this operation
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ComponentModel.Win32Exception: No application is associated with the specified file for this operation
Source Error:
[Code]....
Stack Trace:
[Code]....
[Win32Exception (0x80004005): No application is associated with the specified file for this operation]
LandingSite.LnkRelease1_Click(Object sender, EventArgs e) +215
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Version Information: Microsoft .NET Framework Version:2.0.50727.3607; ASP.NET Version:2.0.50727.3082
View 3 Replies
Sep 7, 2010
I've written a aspx.net(C#) page that after the user has done what they do on the page they hit a Submit button. The Submit button
1) takes the work the users was producing on the page and writes it to a file.
2) attempts to execute a batch file.
The call to the batch file is executed via:
protected void Execute123EDI()
{
try
{
string File = @"c:80sAdminSendV80s.bat";
lblCancelled.Text = lblCancelled.Text + File;
Process proc = new System.Diagnostics.Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.LoadUserProfile = false;
proc.StartInfo.UserName = "administrator";
proc.StartInfo.RedirectStandardOutput = true;
System.Security.SecureString secPass = new System.Security.SecureString();
string paswd = "123abc";
for (int i = 0; i < paswd.Length; i++)
{
secPass.AppendChar(paswd[i]);
}
proc.StartInfo.Password = secPass;
proc.StartInfo.FileName = File;
proc.Start();
FileStream fs = new FileStream(@"c:80sAdminSendV80sOutput.log", FileMode.Append);
StreamWriter sw = new StreamWriter(fs);
sw.Write(proc.StandardOutput.ReadToEnd());
proc.WaitForExit();
sw.Close();
proc.Close();
}
catch(Exception ex)
{
lblDebug.Text = lblDebug.Text + ex.Message + "<br/>";
}
If I watch the processes tab in Task Manager on the web server I see "cmd.exe" under the context of 'administrator' but it just hangs. For test purposes c:SendV80s.bat: copy c: oot.ini c:zzz.txt
If I logon onto the webserver's console and execute SendV80s.bat it works and exits without issue. But when I execute the same batch file via the Submit button it gets stuck executing in Task Manager/Process. I believe this has something to do with the fact that cmd is not running in a full environment/desktop context. I just noticed this on the actual console of the webserver (not in my RDP console but console 0 instead)
A pop-up box stating: CMD.exe Application error The application failed to initialize properly (0xc0000142). Click OK to terminate the application. And when I click on the OK button my ASPX page's WaitForExit is satisfied and the continues processing normally.
View 2 Replies
Apr 3, 2010
I've developed a popup email .aspx used on our intranet based web app that is auto generated with .pdf's attached. I'm developing with VS 2008 ASP.Net 3.5 C# and System.Net.Mail.MailMessage. I can create and send the email with no issues. The problem is with any attempt to open or delete the attachments I get the above error. The .pdf's a copied with the following code:
FileStream fsr = new FileStream(inFilename, FileMode.Open, FileAccess.Read, FileShare.Read);
BinaryReader reader = new BinaryReader(fsr);
byte[] bytes = new byte[fsr.Length];
reader.Read(bytes, 0, bytes.Length);
FileStream fsw = new FileStream(outFileName, FileMode.Create, FileAccess.Write, FileShare.Write);
BinaryWriter writer = new BinaryWriter(fsw);
writer.Write(bytes, 0, bytes.Length);
// clean up
writer.Flush();
writer.Close();
writer = null;
fsw.Close();
fsw.Dispose();
fsw = null;
reader.Close();
reader = null;
fsr.Close();
fsr.Dispose();
fsr = null;
Later after sending the email I:
mailMessage.Dispose();
mailMessage = null;
foreach (string fileName in attachments)
{
if (File.Exists(fileName))
File.Delete(fileName);
}
The error occurs at: the File.Delete(fileName);
how I can delete or reopen these files after sending the email?
View 9 Replies
Oct 17, 2010
I am trying to download a file from the server but i am getting this error:
The process cannot access xxxx the file because it is being used by another process
This is my CODE:
string fileName="DownLoadFiles";
string filePath = hid_filepath.Value;
FileInfo file = new FileInfo(filePath);
System.Net.WebClient wc = new System.Net.WebClient();
wc.DownloadFile(new Uri(fileName, filePath);
Foe ur Information:the file is not opened or not used.
View 1 Replies
Feb 23, 2011
We recently migrated our ASP.NET 2.0 application to ASP.NET 4.0. It is running on Windows 2003 with IIS 6.0. After migrating, we have found that the ASP.NET 4.0 worker process w3wp.exe crashes intermittently with an 'Access Denied' exception. The stack trace of the exception does not point to any code written in our application. We are clueless as to what could be causing this. The worker process crashes when it makes a remoting call over http.
Event Type: Error
Event Source: ASP.NET 4.0.30319.0
Event Category: None
Event ID: 1325
Date: 2/22/2011
Time: 10:01:03 AM
User: N/A
Computer: SYS01
Description:
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/1/ROOT/Remoting
Process ID: 4660
Exception: System.TypeInitializationException
Message: The type initializer for 'ConvertClass_1' threw an exception.
StackTrace: at ConvertClass_1.Finalize()
InnerException: System.Management.ManagementException
Message: Access denied
StackTrace: at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementScope.InitializeGuts(Object o)
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObject.Initialize(Boolean getObject)
at System.Management.ManagementClass.CreateInstance()
at ConvertClass_1..cctor()
For more information, see Help and Support Center at [URL] We have tried options like giving permissions to ASPNET account in the WMI services under 'Component Services' but to no avail. Has anybody else faced this issue?
View 5 Replies
Mar 29, 2010
I simply want to create one file and then delete it, means I want to access one file subsequently. I am getting the very familiar error as shown in title. (Process can't access the file,) I have tried using file stream and all other stuff that I found from Googling but no success so far. Does any body have small and neat solution? in short, I would like to run the following statements without any error.File.Create("C:\hsp1.txt");
File.Open("C:\hsp1.txt", FileMode.Open, FileAccess.Read, FileShare.None);
View 2 Replies
Nov 6, 2010
My code is that I want to create a log file and log it upon a new user browsing the site. However, what i did was I put in a 6 second delay and then used another browser to access the page. And it threw an Exception saying it is being used by another process which is true. So how come I set it so that, if IT is being used by another process, WAIT and retry every 500 milliseconds until it becomes free/available?
here's the code:
protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack) // if this is the first time page loads, set k to 1
{ lognewuser();
}}
[Code]....
View 1 Replies
Mar 28, 2011
I am having the text file which is used to track all the ip address which is available in the network and replace the content from"Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.
For this task i am having 2 functions 1.runCMD() Function is used to create a file which ping all the ip address between 3 to 254 ("Reply from 172.29.116.3: bytes=32 time=1ms TTL=255").
2.Another function textFileReplace() which is used to replace the text from "Reply from 172.29.116.3: bytes=32 time=1ms TTL=255" to 172.29.116.3.
This process will continue every 30 minutes..
But i am having the error while accessing the function textFileReplace() as The process cannot access the file 'C:inetpub' because it is being used by another process.
View 4 Replies
Feb 24, 2011
I have an existing project with a silverlight3 app. First I created SALESservice.svc.This is working fine. Now I added another TARGETservice.svc to my project and rebuilded my entire project but when I am trying to add the service reference in to the silverlight app I get the following error:
There was an error downloading metadata from the address.verify that you have entered a valid address. I didn't write any code in ISALESservice.svc AND ITARGETservice.svc . I have written in SALESservice.svc.cs AND TARGETservice.svc.cs files.Is this causing error? But for SALESservice.svc it is working. I didn't add any code in web.config file.
View 1 Replies
Jul 23, 2010
I have a stored procedure which fetches data after joining 8-9 tables and inserts that into a temp table. It was running fine till now, but now when the amount of data fetched have exceeded 20000, the SP is breaking. I have debugged the sp and found that this main query is failing after returning arround 15000-16000 records.
The error message says Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I know what is deadlock, but when i checked with SP_LOCK stored proc i only found that my process is running on database only. So how is this getting deadlocked when there are no other processes running simultaneously on server.
View 4 Replies
Feb 7, 2011
I am getting error as mentioned below:
The process cannot access file "E:TempPDFsSample.pdf" because it is being used by another process
I happen to send the pdf from email and after email is sent i need to delete the Sample.pdf file. The code that i have written doesn't work
FileInfo DeleteFileInfo = new FileInfo(directoryPath + "\" + filename + ".pdf");
if (DeleteFileInfo.Exists)
File.Delete(directoryPath + "\" + filename + ".pdf");
here directorypath is E:TempPDFs, filename is Sample
UPDATED:
public static void SendMail(string fromAddress, string[] toAddress, string[] ccAddress, string[] bccAddress, string subject, string messageBody, bool isBodyHtml, ArrayList attachments, string host, string username, string pwd, string port)
{
{
try
[Code]....
View 1 Replies
Feb 10, 2010
When I delete all files from the directory path. then it will give me this error The process cannot access the file because it is being used by another process. How to solve this?
View 10 Replies
May 12, 2010
I have an asp.net website and I allready did .Dispose() here is my code below;
try
{
MailMessage newMail = new MailMessage(MailFrom, MailTo,
MailSubject, MailMsg);
if (MailAttachment != "")
{
Attachment data = new Attachment(MailAttachment,
MediaTypeNames.Application.Octet);
newMail.Attachments.Add(data);
}
newMail.BodyEncoding = System.Text.Encoding.UTF8;
newMail.IsBodyHtml = true;
SmtpClient client = new SmtpClient("192.168.2.205");
client.Credentials = CredentialCache.DefaultNetworkCredentials;
client.Send(newMail);
newMail.Attachments.Dispose();
newMail.Dispose();
DeleteAttachment(MailAttachment);
lblSuccess.Text = "Başvurunuz alınmıştır teşekkürler.";
lblSuccess.Visible = true;
ClearForm();
}
catch (Exception ex)
{
lblSuccess.Text = ex.Message;
//lblSuccess.Text = "Bir sorun oluştu bir daha deneyiniz.";
lblSuccess.Visible = true;
}
But i' m getting the same error, it' s running fine in my localhost but in server i' m getting this error. How can i fix it?
View 2 Replies
Feb 8, 2010
I am getting binary data from a SQL Server database field and am creating a document locally in a directory my application has permissions. However I am still getting the error specified in the title. I have tried numerous suggestions posted on the web including those suggested in previous posts on Stackoverflow. I have also used ProcessExplorer > Find Handle to locate the lock and it returns nothing as if the file is not locked.
I am using the code below to save the file to the file system and I then try to copy this file to a new location later in the application process within another method. It is this copy method that takes the path of the newly created file that throws the exception.
The file itself is created with its content and i can open it through Windows Explorer without any problems.
Am I missing something completely obvious? Am I creating the file correctly from the database?
// Get file from DB
FileStream fs = new FileStream(
"C:myTempDirectorymyFile.doc", FileMode.OpenOrCreate, FileAccess.Write);
BinaryWriter br = new BinaryWriter(fs);
br.Write("BinaryDataFromDB");
fs.Flush();
fs.Close();
fs.Dispose();
// Copy file
File.Copy(sourceFileName, destinationFilename, true);
View 7 Replies
Oct 5, 2010
Iam getting the above said error while Iam copying a file of relativelly Heavy say 130 MB.Below is the code which is giving the error.
System.IO.FileInfo FileInfo1 = new System.IO.FileInfo(filename1);
FileInfo1.CopyTo(strDestPath,true);
View 6 Replies
Feb 6, 2012
I am using a AsyncUpload(telerik), i am in a point where i am supposed to save the File to a certain Folder. First I check if the directory exist
Code:
Dim baseDire As String = Server.MapPath("~/MyFILES/")
If IO.Directory.Exists(baseDire & Request("Req_ID").ToString()) = False Then
IO.Directory.CreateDirectory(baseDire & Request("Req_ID").ToString())
End If
Because i am doing multiple Upload , i will have to loop through the items of the Upload control and save to a folder.
Code:
For Each file As UploadedFile In UploadPropDoc.UploadedFiles
Dim bytes(file.ContentLength - 1) As Byte
file.InputStream.Read(bytes, 0, file.ContentLength)
'Save the File to the disk
file.SaveAs(baseDire + file.GetName())
Next
Now when ever i debug this , when it comes to this line
Code:
file.SaveAs(baseDire + file.GetName())
I get an Error
The process cannot access the file because it is being used by another process.
I have removed the Readonly in the Folder that it supposed to write to and gave everyone permission , but still the error persist.
View 1 Replies
Jan 14, 2013
I have made an application where I am displaying the .pdf , .doc , .docx files. These files are uploading from an Admin Panel.When user place a mouse pointer on download icon provided in front of every file, it shows the complete path where it’s get saved.I want to avoid this path visibility even when user place mouse on download icon and even if it Inspect an element (as most modern browser will have this functionality).
View 1 Replies