Problems with File.Copy() Method for copy big files

I´m using the follow commando to copy a file:

source = "c:\\domains\\\\wwwroot\\folder\\filesou.xml";
target = "c:\\domains\\\\wwwroot\\folder\\filetar.xmb";

File.Copy(source, target, true);

If I used a small file (source) with for example 233000 bytes the server copy to target without problems.

But if I used the file (source) with 700000 bytes the server don´t copy.

I´ m copy to the same folder...

Why is this happened with big file as source ?

Thank you...


8/17/2005 2:27:36 AM 91979 articles. 4 followers. Follow

6 Replies

Similar Articles

[PageSpeed] 23

Does it throw any error. 

Wanna get high!
8/17/2005 7:22:08 AM

I don´t know if it throw any error.

How can I get any error return the File.Copy() Method ?

Thank you,

8/17/2005 11:42:32 AM
Well what happens when you try do the large file copy? Does it just not work and you only know by checking the copy location? Or does the application throw an exception of some sort that you catch?
8/17/2005 1:34:59 PM

I just tried it with

System.IO.File.Copy( Server.MapPath( "~/NetShow50_300k.wmv" ), Server.MapPath( "~/" ) + "Copy of NetShow50_300k.wmv", true );

The NetShow50_300k.wmv file is 222Mb. So there is definately no framework limitation with your file. As per the question asked here the only limitation should be permissions and physical space.

8/17/2005 1:45:37 PM
I've noticed with copying large files that the .NET Framework (the aspnet worker process I believe) will limit itself to something like only 70% of the available RAM memory, and if the process tries to exceed that, it'll stop itself. 

I can't remember the percentage figure exactly, but a message will show up in the Event Viewer, so check there.

I guess it's a safety feature. Not really a bad thing, eh?
Software Programmer For Hire
8/17/2005 1:57:54 PM
There is a threshold you are right. But file copy is usually a very small footprint operation. It streams data from one file directly to a writing stream. This really shouldn't make an impact unless your system is already under a lot of stress.
8/17/2005 8:54:32 PM

Similar Artilces:

File.Copy and File.CopyTo DO NOT COPY CONTENTS OF FILE!@
I posted on here before but no one has been of any help. I am trying to copy files of type .zip .jpg and .pdf from ones folder to another (I dont want to move it, just make a copy). How can I do this? When I use File.Copy and File.CopyTo it makes a new file in the right folder but has no content and it also erases the content on the orignal file. WTF? This is really making me mad. Visit #1 Windows Vista Forum Here you go --->, Narayana Rao Surapaneni Architect | Author | MCSD for .NET | MCSD | SCJP ww...

Problem Copying a file from remote client using File.Copy
Hello, I have to copy a file that is uploaded from a remote client to Web Server into my application folder. I am using the following logic to achieve this. File.Copy(srcPath, destPath) Where srcPath = Path selected by the user using HTML File Input Control. and destPath = Server.MapPath(Excel_Upload) + "\Sample.xls" This works fine when I try uploading the file from the server system but when I try doing the same from a remote client, I get an exception which says "File.Copy Could not find a part of the path 'C:\Documents and Settings\Anas\Desktop\Sample12.xls'&...

What is the maximum file size that can be copied using File.Copy method ?
What is the maximum file size that can be copied using File.Copy method ?HighOnCodingWanna get high! It should only be restricted by available space. The copy function is just a wrapper for the Win32 copy funtion in kernal32.dll salam azam i do not know if this useful Alnassar | FREE Nodil Tab Control Thanks It was helpful. HighOnCodingWanna get high! great to know this .......i owe you alot brother !! i always feel that i like to help people who always help meFadil Alnassar www.fa...

Copying more than one file using File::Copy
Good day=3B I apologize in advance if this is a very stupid question=85 I=27m trying to concatenate two files and have the results written to a = third file=2E = Maybe I=27m missing something obvious=2E=2E=2E but in Perldoc for File=3A= =3ACopy I = read=3A =22The copy function takes two parameters=3A a file to copy from = and = a file to copy to=2E=22 What can I do if I have a second file I want to copy from=3F (i=2Ee=2E Li= ke = DOS copy command=3A c=3A=5C file1=2Etxt + file2=2Etxt file3=2Etxt will co= py the = contents of file1=2Etxt =26 file2=2Etxt and put the...

Copying all files in a directory using either file.copy or directory.copy across volumes
I need to copy all the files from a cd directory to a directory on my harddrive. I have tried the directory.copy method but it will not allow me to copy across volumes. I have tried the file.copy method but you must specify a file name in the path as well as the target. This sort of defeats the purpose of what I am trying to do. Basically I am using a radio button to specify a type of CD and based on this selection the application knows what directory to look in for the files I want. Here is the script I tried last to move the file. Sub KPacs(ByVal sender As Object, ByVal e As System.EventA...

File.Copy does not release the lock on the copied file.
 Hi! I am trying to use the File.Copy function in order to copy a file from the Client's PC to the Server. The File to be copied is selected by the user using the FileUpload control and is then used by the server to perform certain operations. My problem is that when I copy the file using the File.Copy method and then execute a streamreader process on the file straight after, I get the following error; "The process cannot access the file '\\syddev1\latest\xmasEmail.html' because it is being used by another process. " Below is the piece of code where the problem...

File::Copy::copy() dies on identical files?
I'm giving File::Copy's tests a bit of a face-lift and I came across this: eval { copy("copy-$$", "copy-$$") }; printf "ok %d\n", 15+$loopconst unless $@ =~ /are identical/ && -s "copy-$$"; which basically says, "copy() should die if given the same source and destination file" which is a little extreme. Warn perhaps, but not die. I think it's just parroting the behavior of the 'cp' shell command. If nobody has any objections, I'll downgrade that to a warning and copy() just succeeds. P...

FileConents not getting copied with File.Copy
string path = Session["FullPath"].ToString(); // Create the file and clean up handles.using (FileStream fs = File.Create(path)) { } // Ensure that the target does not exist.   // string path2 = @"C:\Inetpub\wwwroot\WebSite1\Images\" + strFolderName + @"\" + FileName;string path2 = Server.MapPath("Images"); path2 = path2 +"\\"+ strFolderName + "\\" + FileName;File.Copy(path1,path2); //File.Move("C:\\Inetpub\\wwwroot\\WebSite1\\Images\\Patient1\\120_UK_15.10.2030.bmp", "C:\\Inetpub\\wwwroot\\WebSite1\\Ima...

Error when copying using File.Copy and files exist
I'm trying to copy and overwrite files to an existing directory using :file.copy(source,destination,true)The command works perfectly when the files do not exist, but when trying to overwrite the files, I get an access denied error to the destination directory and files.It's not a permission issue because the folders have 'ASPNET' and 'Everyone' Access set up with full rights.Anyone have any ideas?Thanks in advance.JeffJeff Wasilauski, MCAD .NET, MCPC# WEB DEVELOPMENT-SQL SERVER DBA"If I have answered your question please mark as answer" Check if the File exists before copying and...

copying a file without using module File::Copy
Hello All, Is the only way to copy a file from one directory to another by using the copy module...? Would anyone have a snipet of code copying a file from one dir to another... Any assistance would be appreciated... Thank you, Mike ------------------------------------------------ On Fri, 14 Feb 2003 10:13:06 -0500, Michael Pastore <> wrote: > > Hello All, > > Is the only way to copy a file from one directory to another by using the > copy module...? > > Would anyone have a snipet of code copying a f...

file to file copy
--nextPart3236501.eDU2PhZZ46 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit hello, i have to write a perl script which copies text from one file to another but only if the text is not exisiting yet. For example: in file1: word: moon word2: sky .... the same syntax for every line in file2: #some text word: honey word3: lol word4: mu .... as well the same syntax for every line so now i want to merge file1 into file2, so that word: honey will be replaced by word: moon and word2: sky will be appended to file2. i have written the following...

large single file file copy problems
I am not sure if this is a client issue but I thought I would ask. I have win2k sp3, client 4.9 sp1. zfd4 agent dated 3/29/04, nw51 sp6. I am having an issue copying files that are large in size but not folders that have multiple files that are large in size. an example would be if I copy an image that is 900mb. the file copies all the way to the last 10 percent then just sits there with the dialog box never going away. trying to end task the process causes my system to lock up and I have to reboot. looking at the file size that was copied and it is correct but the file is corrupt. you ...

Add water mark using PJL and Get the file path for print jobs or Get copy of the print jobs file.
Hi,  I want to know how to set water mark to Hp printer using PJL and I want to know how to get the file path for print jobs. I got print job document names. But i want to get copy of the print jobs file. ...

Script file to copy files
Dear all, I have an external hard disk with lots of big files and a lot of small matlab script files .m. I would like to grab all the files inside that harddisk that have the .m extension or the *.mat file extension (both are matlab files). Of course this is a -first-find the *.m files script and -then copy the files into the hard disk. What I do not know is how I can also keep the structure of the folders containing the *.m and *.mat files when I will copy them in my local hard disk. As this external hard disk contains 2TB of data it is not possible to copy all the fi...

Web resources about - Problems with File.Copy() Method for copy big files -

Problem novel - Wikipedia, the free encyclopedia
Working class, or proletarian novels are often also social problem novels . This was in many ways a reaction to rapid industrialization , and ...

iOS 9.2 ‘might’ fix the blackout problem some iPad Pros have, says Apple
... iOS Devices Check out 9to5Mac for more breaking coverage of iOS Devices . What do you think? Discuss "iOS 9.2 ‘might’ fix the blackout problem ...

Apple suggests iOS 9.2 will fix unresponsive iPad Pro problem
... by pressing and holding the Sleep/Wake and Home button for 10 seconds, until the Apple logo appears. With the release of iOS 9.2, that problem ...

FBI Director: Silicon Valley’s encryption is a “business model problem”
... attacks in Paris and California. Today, FBI director James Comey has suggested that Silicon Valley isn't faced with a serious technical problem, ...

Audi says fixing diesel emission problem is simple
... Green , Audi , Porsche , Volkswagen , Emissions , Diesel , Luxury Audi believes a simple fix might be enough to solve the emissions problem ...

The FBI finally gives a clear explanation about its problems with encryption
The FBI is still banging the drum for tech firms to give it a "backdoor" to encrypted devices and this time it's offered a clear explanation ...

A ton of actresses are talking about how to tackle Hollywood's gender problem
Back in October, Jennifer Lawrence wrote an essay about her struggle to be paid fairly for "American Hustle." The essay went viral and inspired ...

VW: CO2 emissions problem far smaller than suspected
Company says "slight deviations" were found in nine variants of VW brand models, including the Jetta, Golf and Passat

Can Cisco fix workplace video problem?
Cisco has spent decades building products for IT managers and engineers. It's now trying to adopt a consumer mentality.

Volkswagen says carbon dioxide emissions problem is smaller than feared
Results from an internal probe lets the beleaguered carmaker move on from the latest carbon dioxide problem and focus on the larger diesel-emissions ...

Resources last updated: 12/11/2015 5:51:50 PM