How to upload a file using a form

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • navaldesign
    replied
    Re: How to upload a file using a form

    You need to use a code like

    $upload_Name1 = $_FILES[$file_key]['name'];
    $upload_Name = $prefix.str_replace(" ", "_", $upload_Name1);
    $upload_Size = ($_FILES[$file_key]['size']);
    $upload_Temp = ($_FILES[$file_key]['tmp_name']);
    $upload_Type = ($_FILES[$file_key]['type']);
    if($upload_Type != "image/gif" AND $upload_Type != "image/pjpeg" AND $upload_Type != "image/jpeg" AND $upload_Type != "image/png" AND $upload_Type != "image/tiff" AND $upload_Type != "image/bmp"){
    $error1 = "$file_key file type is '$upload_Type' which is not allowed! \n";
    // Add here a "include" command to include an error page
    }

    Leave a comment:


  • dritar
    replied
    Re: How to upload a file using a form

    Can someone help me please? Or can someone suggest me... How to protect the upload from hackers?

    Leave a comment:


  • dritar
    replied
    Re: How to upload a file using a form

    Hello, how can i make the script to filter the file extensions?

    Like i want that possible file types to upload are just .ZIP and .PNG

    Leave a comment:


  • navaldesign
    replied
    Re: How to upload a file using a form

    ABVFP is far more versatile than this script. And it will also mail you the attached files.

    However, we can't help you with this error, because this depends on your code. You must have missed a closing } somewhere.

    Leave a comment:


  • jessyh89
    replied
    Re: How to upload a file using a form

    hi...i know this thread was from a long time ago and i'm hoping i can still get some help... i followed these instructions as best i could, then when i tried to test my form, it came up with a screen saying
    "Parse error: syntax error, unexpected $end in /home/ezioxokc/public_html/members/uploadaction.php on line 156"
    could someone please tell me what this means and what i've done wrong?
    this is gonna sound stupid but was i meant to delete the red writing? is that what i did wrong? or is it because i put it into a password protected directory inside the public_html folder?

    sorry to be such a pain!

    thanks, jess

    P.S. i have tried ABVFP but it doesn't seem to agree with me :( but now i appear to be having the same trouble with this way...
    Last edited by jessyh89; 12-12-2007, 04:52 AM. Reason: more info

    Leave a comment:


  • navaldesign
    replied
    Re: How to upload a file using a form

    Did you create the "uploadaction" page and publish it as php ?

    Leave a comment:


  • deanone1
    replied
    Re: How to upload a file using a form

    Can some help, I tried all this and (the steps to allow visitors upload flies and images) but when I try my upload form and click submit it says this;

    Not Found

    The requested URL /uploadaction.php was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.




    why is this can someone help?

    Leave a comment:


  • sebastianmuntean
    replied
    Re: How to upload a file using a form

    Maybe VH lowered the limit to 2MB... However, it's very annoying, I'll try to talk with VH guys about that because I cannot teach my client how to use FTP to upload his videos on his website

    Anyway, thanks for your help!
    Sebastian

    Leave a comment:


  • navaldesign
    replied
    Re: How to upload a file using a form

    You can NOT set the server limit, VH sets it. Usually only 4.77 is allowed. For larger files you need to use FTP or File Manager. Seems strange that 2.1 Mb is not uploaded, as said most VH servers are set to 4.77.

    Leave a comment:


  • sebastianmuntean
    replied
    Re: How to upload a file using a form

    I know that I changed the file limit to 1GB, I just wanted to be sure that I can upload any file I want until I get it fixed...

    Even the php 52 MB can be a reasonable limit... but 2MB is much to low...

    Leave a comment:


  • sebastianmuntean
    replied
    Re: How to upload a file using a form

    Originally posted by navaldesign View Post
    Depending on the server settings, php will allow you to upload files up to 52 MB. Usually VH servers are set to 4.77 Mb.

    1000000000 that you have set, is 1 Gb !!!

    The script WILL give an error if the size is bigger than the set limit. Of course, if you have it set at 1 Gb, you will get no error message, though the file will not be uploaded if bigger than the server settings.
    I will need to upload files between 10 and 200MB (video files)... This VH server seems to be set to 2MB, as 1.9MB files are uploaded and 2.1MB are not... Do you have any idea what can I do to change the server limit?

    Leave a comment:


  • navaldesign
    replied
    Re: How to upload a file using a form

    Depending on the server settings, php will allow you to upload files up to 52 MB. Usually VH servers are set to 4.77 Mb.

    1000000000 that you have set, is 1 Gb !!!

    The script WILL give an error if the size is bigger than the set limit. Of course, if you have it set at 1 Gb, you will get no error message, though the file will not be uploaded if bigger than the server settings.

    Leave a comment:


  • sebastianmuntean
    replied
    Re: How to upload a file using a form

    ... and no error is displayed while a file is bigger than 2MB...

    Leave a comment:


  • sebastianmuntean
    replied
    Don't allow bigger files

    Hello!

    I was trying to upload files using different scripts including BV one explained here but I have problems with size limit. I think the server don't allow to upload files bigger than 2MB...

    I changed the limit into the script to $upload_Size >1000000000.

    The upload form is installed on a Voda hosting, http://www.normal.ro/sbs/1.html

    Is anyone who knows how can I make server let me upload bigger files?

    Thanks,
    Sebastian

    Leave a comment:


  • navaldesign
    replied
    Re: How to upload a file using a form

    No, it is a self standing file. You create it in Notepad and you upload it in your file using FTP.

    Leave a comment:

Working...
X