meclive wrote:

Thanks for the reply, im a bit of a noob at php 🙂 where do i input the url of the file to be copied? Do i need to create a form and post it as the variable "File"?

With this script no, its required you enter the "address" too be copied from the URL like so:

(This is an example, presume that http://myexample.com/SomeFile.php is the path too your PHP file).

http://myexample.com/SomeFile.php?File=http://someplace.com/index.html

For example, it can be easily modified too work throughj a form though - if thats required I'll be glad too help you with it :-)

Cheers,

Ryan Jones

    Thanks, well im getting this error when trying to download file.txt (i have chmod the folder to 777):

    Warning: fopen(/file.txt): failed to open stream: Permission denied in /home/public_html/test.php on line 7

      meclive wrote:

      Thanks, well im getting this error when trying to download file.txt (i have chmod the folder to 777):

      Hmm, did you set $ToDir = './'; correctly?

      Maybe you should try this instead:

      $ToDir = '/home/public_html/';

      Cheers,

      Ryan Jones

        woo hoo, it seems to have worked for that text file, thanks a lot 🙂 just going to try with some bigger files and different filetypes.

          meclive wrote:

          woo hoo, it seems to have worked for that text file, thanks a lot 🙂 just going to try with some bigger files and different filetypes.

          As long as yournot intending to work with Huge files then the script should work fine, if you are then you'll need a bit more work :-)

          Cheers,

          Ryan Jones

            RyanJones wrote:

            As long as yournot intending to work with Huge files then the script should work fine, if you are then you'll need a bit more work :-)

            Cheers,

            Ryan Jones

            Yeah i've noticed it seems to stop working and only download a bit of the bigger files, any ideas on what i could look into to stop this? thanks.

              meclive wrote:

              Yeah i've noticed it seems to stop working and only download a bit of the bigger files, any ideas on what i could look into to stop this? thanks.

              How big would the file be?

              Cheers,

              Ryan Jones

                Well i seem to have problems with any file above 35mb.

                  meclive wrote:

                  Well i seem to have problems with any file above 35mb.

                  Hmm, it may be a problem with the file() funciton, try replacing it with the fopen (http://uk.php.net/fopen) and fread (http://uk.php.net/fread) functions and see if that fixes it :-)

                  Cheers,

                  Ryan Jones

                    It may also be a configuration limit (one of memory_limit, upload_max_filesize, post_max_size, max_input_time, say).

                      Write a Reply...