Results 1 to 6 of 6

Thread: JS PHP

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215

    JS PHP

    , ... .
    :
    , .
    - iframe.
    . . Ajax , ... , iframe - .
    , ... temp file, PHP , .
    , ( Uploadify ), , flash, js .

    .

  2. #2
    Registered User
    Join Date: Jul:2001
    Location: Redmond, USA
    Posts: 1,699
    upload- , Open File ? Flash ( ).
    Soltek 75FRN2-RL bred "B" 1700+ : 1466@2300(11.5x200) 1.85V 512 MB DDR333 TwinMOS: 11-3-3-2@2.8V Leadtek Geforce4Ti 4200 128 MB : 300/600 80GB Seagate 7200.7 CDROM 48x BenQ Enermax EG365P-VE/FCA 350W Creative DT2200 5.1 Middle Tower Water Cooling

  3. #3
    Registered User FuLLmaXx's Avatar
    Join Date: Jan:2007
    Location: UK
    Posts: 540
    Quote Originally Posted by Rear Admiral Floyd View Post
    upload- , Open File ? Flash ( ).
    , , . Gmail . 100 , .

  4. #4
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    , .

    :

    1. PECL extension uploadprogress:

    Now that PHP 5.2 supports a hook that can be used to handle upload progress, you can use a PECL extension (uploadprogress) to display an upload progress meter. Since documentation for this PECL extension is a bit thin on the ground, here are the basics:

    1) Run "pecl install uploadprogress", and add "extension=uploadprogress.so" in your php.ini file.
    2) Tell the extension where to temporarily store information about each upload. By default, this is in "/tmp/upt_%s.txt" (where %s is replaced with the UPLOAD_IDENTIFIER, see below). You can change it with the following config line:
    uploadprogress.file.filename_template = /path/to/some_name_%s.txt
    It must have a single '%s' in it, or it will fail!
    3) Add a hidden element at the very beginning (this is important) of your upload form, called UPLOAD_IDENTIFIER. The value of this should be match the expression "^[A-Za-z0-9_.-=]{1,64}$" and be unique for every upload.
    4) When the form is submitted, pop open a window to display the progress information and continue submitting the form. This window should refresh itself every few seconds, calling a PHP script that will retrieve the progress information and generate a display meter.

    This script calls the function uploadprogress_get_info($id), where $id is the UPLOAD_IDENTIFIER value. This will return false if there is no progress information, or an array of values about that upload. The array contains:

    time_start - The time that the upload began (same format as time()).
    time_last - The time that the progress info was last updated.
    speed_average - Average speed. (bytes / second)
    speed_last - Last measured speed. (bytes / second)
    bytes_uploaded - Number of bytes uploaded so far.
    bytes_total - The value of the Content-Length header sent by the browser.
    files_uploaded - Number of files uploaded so far.
    est_sec - Estimated number of seconds remaining.

    The speed_average is measured based on the number of bytes uploaded since the upload began, whereas the speed_last is based on the number of bytes uploaded since the progress information was last updated. The progress information is updated whenever PHP reads in some more data from the client, so speed_last may not be very accurate.

    Note 1) The bytes_total figure is NOT a reflection of the file size, but of the POST's size, so don't expect them to match.

    Note 2) This module really only detects how much data the POST form has sent, and keeps a running count of how many POST variables of type 'file' that it encounters along the way. It has no way of knowing how many files are in the POST, so it is not possible to have a progress bar for each file, just one for all files (and the ability to display how many files have been uploaded so far).
    2. APC:

    http://www.phpriot.com/articles/php-ajax-file-uploads/3


    , - flash .
    - upload speed ...

  5. #5
    gibona's Avatar
    Join Date: Feb:2005
    Location: Sofia
    Posts: 3,074

  6. #6
    Registered User
    Join Date: Jul:2005
    Location: Sofiq
    Posts: 2,798
    : http://www.vplay.ro/upload/ . Chrome FF. AJAX Upload. http://i.vplay.ro/js/upload/upload_html5_v2.js?v=0.4 . upload html5 AJAX,

    PHP
    Code:
    $uploaded_file = tempnam("/tmp", "UPL");
    $temp = fopen($uploaded_file, "w+");
    $input = fopen("php://input", "r");
    $realSize = stream_copy_to_stream($input, $temp);
    fclose($input);
    , . js . , 2GB, . , PHP-.
    Last edited by _ShadoW_; 14th March 2011 at 16:57.

Posting Permissions

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

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |