simple file transfer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Benny Schudel

    #1

    simple file transfer

    hello

    how can i simple transfer a file from a server to my server and display
    the progress with ajax in the users browser?

    i've tried with curl, but i cant get the progress.
    are there any libraries for simple file transfers out there?

    kind regards
    //B

  • reandeau

    #2
    Re: simple file transfer

    Try Uber Uploader, its a combo of PHP, Perl and Javascript at:
    Uber Uploader is an open source file upload mechanism that uses AJAX to displays the status of an upload in the form of a progress bar.



    Regards

    Jon Tjemsland

    Comment

    • Benny Schudel

      #3
      Re: simple file transfer

      Thank you.

      But I'm not looking for an upload progress.
      I'd like to transfer Files between two servers after a user action. The
      user should then have a response about the progress.

      regards
      //Benny

      Comment

      • Chung Leong

        #4
        Re: simple file transfer


        Benny Schudel wrote:[color=blue]
        > hello
        >
        > how can i simple transfer a file from a server to my server and display
        > the progress with ajax in the users browser?
        >
        > i've tried with curl, but i cant get the progress.
        > are there any libraries for simple file transfers out there?
        >
        > kind regards
        > //B[/color]

        You can attend a callback function to a PHP stream. I am not sure if
        it's sufficient for what you're trying to do. From an old post:

        $context = stream_context_ create(array()) ;
        stream_context_ set_params($con text,
        array('notifica tion' => 'stream_callbac k'));
        $f = fopen("http://www.google.com/", "rb", false, $context);

        The parameters passed to the function are as followed:

        function stream_callback (
        $notifycode,
        $severity,
        $xmsg,
        $xcode,
        $bytes_sofar,
        $bytes_max)

        Notification codes are defined as such:

        1 = RESOLVE
        2 = CONNECT
        3 = AUTH_REQUIRED
        4 = MIME_TYPE_IS
        5 = FILE_SIZE_IS
        6 = REDIRECTED
        7 = PROGRESS
        8 = COMPLETED
        9 = FAILURE
        10 = AUTH_RESULT

        Severity codes:

        0 = INFO
        1 = WARNING
        2 = ERROR

        Comment

        Working...