PHP Classes

Problem with fwrite/file_get_contents

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  Problem with fwrite/file_get_contents  
Subject:Problem with fwrite/file_get_contents
Summary:File read using file_get_contents but not written using fwrite
Messages:2
Author:Dhaval
Date:2011-07-26 15:45:08
Update:2011-08-06 06:25:16
 

  1. Problem with fwrite/file_get_contents   Reply   Report abuse  
Picture of Dhaval Dhaval - 2011-07-26 21:42:05
Hi,

I am opening a file on a remote FTP location (let's call it FTP 1) using file_get_contents and completely reading it. The file size on an average is about 25000 bytes. This file contains XML tags. Next, I am opening another a new file on FTP location (say FTP 2) and using fwrite, I am writing the contents of the file on FTP 1 to the file on FTP 2.

In about 80% of the cases, the file on FTP 2 gets successfully written. However, in about 20% of the cases, the file on FTP 2 is either 0 bytes or 8688 bytes.

I have not been able to identify why the file is not written successfully on some occasions. If you can throw any light on this problem, I will be very grateful.

Thanks,
Dhaval

There is 1 reply in this thread, which is not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.