Professional Web Applications Themes

Download and upload a file - PHP Development

Hello, I would like a php script to download a file from another server and save it on my server. How can I do it? When I search for "download" all I get is how to download a file from webpage to local, and "upload" is local- to server. Just give me some keywords :) Regards, Talthen...

  1. #1

    Default Download and upload a file

    Hello,
    I would like a php script to download a file from another server and save it
    on my server. How can I do it? When I search for "download" all I get is how
    to download a file from webpage to local, and "upload" is local- to server.

    Just give me some keywords :)

    Regards,
    Talthen


    Guest

  2. #2

    Default Re: Download and upload a file

    http://us2.php.net/manual/en/ref.filesystem.php

    fopen()
    fread()
    fwrite()
    file_get_contents()
    file_put_contents()

    ZeldorBlat Guest

  3. #3

    Default Re: Download and upload a file

    Uzytkownik "ZeldorBlat" <com> napisal w wiadomosci 
    thx :)

    Regards,
    Talthen


    Guest

  4. #4

    Default Re: Download and upload a file

    Uzytkownik "ZeldorBlat" <com> napisal w wiadomosci
    news:googlegroups.com... 

    I have written a nice script in notepad, copied it onto my server. Run and I
    got:

    Warning: fopen(): URL file-access is disabled in the server configuration in
    /home/webpage/get_file.php on line 2
    The line 2 is:
    $fin=fopen($_REQUEST['getfile'],"rb");

    I am not the admin of the server, so how could I (in another way) download a
    file from URL to server?

    Regards,
    Talthen


    Guest

  5. #5

    Default Re: Download and upload a file

    Yeah, allow_url_fopen needs to be enabled in php.ini for that to work.
    I'm not sure of another easy way, but check out the Curl libraries:

    http://www.php.net/curl

    Of course, that would require that PHP is compiled with Curl support.

    Anyone else have any suggestions?

    ZeldorBlat Guest

  6. #6

    Default Re: Download and upload a file

    Uzytkownik "ZeldorBlat" <com> napisal w wiadomosci
    news:googlegroups.com... 

    Ok, thx, will see it. Currently i have:

    exec("wget '".$_REQUEST['getfile']);

    Should work, but I can't see progress info ;/

    Regards,
    Talthen


    Guest

Similar Threads

  1. File upload/Download/Remove/Progress
    By ThinkFlash in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: March 18th, 07:42 AM
  2. Upload / Download file
    By Andy in forum Linux / Unix Administration
    Replies: 4
    Last Post: October 19th, 02:41 PM
  3. File Upload and DownLoad
    By Karuppasamy in forum ASP.NET Web Services
    Replies: 4
    Last Post: February 7th, 11:28 AM
  4. File upload/download - help appreciated !!!
    By Fredrik/Sweden in forum ASP Database
    Replies: 1
    Last Post: October 12th, 04:24 AM
  5. File Upload and Download
    By Anil in forum Oracle Server
    Replies: 1
    Last Post: October 9th, 07:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139