Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    51
    Thanks
    6
    Thanked 12 Times in 12 Posts

    Upload Script Help

    Hi, I'm trying to make an upload page so that a user can upload files into an archive folder for this organization... and I've run into a couple of problems...

    1) When I try to upload a big enough file, I get
    "Error 103 (net::ERR_CONNECTION_ABORTED): Unknown error."

    2)When it does actually go through I get this error:
    "The requested resource
    /upload.php
    does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit."

    so, I googled this problem and people suggested to add things to .htaccess file, and I did... here is what I put down:

    php_value upload_max_filesize 200M
    php_value post_max_size 200M
    php_value max_execution_time 800
    php_value max_input_time 800

    and that didn't help solve the problem. What should I do?

  • #2
    New Coder
    Join Date
    Aug 2011
    Posts
    51
    Thanks
    6
    Thanked 12 Times in 12 Posts
    Here is the code if that helps:
    PHP Code:
    $target_path "Archives/".$_POST['view']."/";

                    
    $target_path $target_path basename$_FILES['uploadedfile']['name']); 

                    if(
    move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
                            echo 
    "The file ".  basename$_FILES['uploadedfile']['name']). 
                        
    " has been uploaded";
                    } 
                    else if(!isset(
    $_FILES['uploadfile']))
                    {
                        echo
    '<center><table><form enctype="multipart/form-data" action="upload.php" method="POST">
                        <tr align=left><td>Upload to 
                        <select name=view>
                        <option value=E-Board>Admin</option>
                        <option value=Public>Public</option>
                        </select> Section.</td></tr>
                        <tr align=left><td>Choose file: <input name="uploadedfile" type="file" /></td></tr>
                        <tr align=left><td><input type="submit" value="Upload File" /></td></tr></table></center>
                        </form>
                    '
    ;
                    }
                    else{
                    echo 
    "There was an error uploading the file, please try again!";
                    } 

  • #3
    New Coder
    Join Date
    May 2009
    Location
    philippines
    Posts
    50
    Thanks
    6
    Thanked 1 Time in 1 Post
    Quote Originally Posted by ASTP001 View Post
    Here is the code if that helps:
    PHP Code:
    $target_path "Archives/".$_POST['view']."/";

                    
    $target_path $target_path basename$_FILES['uploadedfile']['name']); 

                    if(
    move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
                            echo 
    "The file ".  basename$_FILES['uploadedfile']['name']). 
                        
    " has been uploaded";
                    } 
              echo 
    "There was an error uploading the file, please try again!";
                    } 
    i'm curious with the error that you are getting. i also use nearly the same sequence of codes for my uploads and i don't get any errors since i've used them. what's slightly different with our codes is with the way the target path is constructed. i use absolute path for my target folder utilizing '$_SERVER['DOCUMENT_ROOT']' and then appending my target folder for saving the files. if you're using relative path for your $target_path, shouldn't there be a '.' or a '..' before the 'Archive' folder?

  • #4
    New Coder
    Join Date
    Aug 2011
    Posts
    51
    Thanks
    6
    Thanked 12 Times in 12 Posts
    Quote Originally Posted by sim_pack View Post
    i'm curious with the error that you are getting. i also use nearly the same sequence of codes for my uploads and i don't get any errors since i've used them. what's slightly different with our codes is with the way the target path is constructed. i use absolute path for my target folder utilizing '$_SERVER['DOCUMENT_ROOT']' and then appending my target folder for saving the files. if you're using relative path for your $target_path, shouldn't there be a '.' or a '..' before the 'Archive' folder?
    The Archive folder is in the root folder, so I think I don't have to do it. When I upload small files, it goes to the correct location.

  • #5
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, did you solve the problem? I have the same issue and I can't find an answer.
    Thanks.

  • #6
    New Coder
    Join Date
    Aug 2011
    Posts
    51
    Thanks
    6
    Thanked 12 Times in 12 Posts
    Well, I didn't solve the problem exactly. What I did is tried to use the code set_time_limit() and my webpage gave me an error saying that the function was disabled for security reasons. So, my host just doesn't allow me to temper with these things is the conclusion that I got to. I either need to upgrade to a premium host, or find a better way around this. If anyone has any ideas, that would be much appreciated.


  •  

    Posting Permissions

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