Php url uploader error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Php url uploader error

    Hi, good day my fellow programmers, i need help in
    making a url file uploader

    in normal uploader, we use
    $_POST[file][size];

    to get the uploaded file size.

    So i want to know what i will use to get the file size in a url uploader,
    I tried
    $file=("$_Post[file]");
    $size= filesize('$file');

    but it did not work
    Last edited by bestman; 04.11.11, 15:37.

    #2
    $file = $_POST['file'];
    $size = filesize($file);

    Comment


      #3
      I have done it and it did not work the file was uploaded but the size was not stored

      Comment


        #4
        U need to use $_FILES global for form method file upload, not $_POST.
        See this for details: file-upload.post-method
        Last edited by arnage; 04.11.11, 17:46.
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          PHP Code:
          function remote_filesize($url)
          {
          ob_start();
          $ch curl_init($url);
          curl_setopt($chCURLOPT_HEADER1);
          curl_setopt($chCURLOPT_NOBODY1);
          $ok curl_exec($ch);
          curl_close($ch);
          $head ob_get_contents();
          ob_end_clean();
          $regex '/Content-Length:\s([0-9].+?)\s/';
          $count preg_match($regex$head$matches);
          return isset(
          $matches[1]) ? $matches[1] : "unknown";

          Comment


            #6
            Thanks for ur effort but did not work

            Comment

            Working...
            X