www.webdeveloper.com
Page 1 of 3 123 LastLast
Results 1 to 15 of 36

Thread: Upload file CGI not working

  1. #1
    Join Date
    Jun 2003
    Posts
    28

    Upload file CGI not working

    I used the following "Upload file" from this site and with no success. According to the script I need the "some-script.cgi" file. Am I suppose to substitute this cgi for a common cgi? If so where can I find it?

    Here's the part of the "upload file" that I found here pointing to a cgi file that I obviously needed:

    <form method=post name=upform action="/cgi-bin/some-script.cgi" enctype="multipart/form-data">
    <input type=file name=uploadfile>

    Thx for any help that anyone can give.

    - HiTekMom

    P.S. The simple file upload capabilities that I want is just like the one included in this format to a "Attach file
    Last edited by hitekmom; 06-28-2003 at 03:52 PM.

  2. #2
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Sounds like you don't have any script at all, so take a look at http://cgi.resourceindex.com/Program...ile_Uploading/

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  3. #3
    Join Date
    Jun 2003
    Posts
    28
    I went to the site you listed, thank you very much! I installed one of the scripts to my cgi-bin and replaced the "some-script.cgi" with the scripted I download. I tried the script in the .html file given and with the .htm file I already had and received this msg on both times:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@monicar.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Maybe this is a problem I need to contact my host provider with?

    Thx again, you are a doll.

  4. #4
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Did you CHMOD the files, or probably more important, the directory that you are trying to upload to. The script probably has some documentation telling you what these need to be CHMODed to. Probably 777 or 766

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  5. #5
    Join Date
    Jun 2003
    Posts
    28

    Need Your Help, Still!!!

    Okay! Here's what I've done --

    1) I've changed the CHMOD to 755 (according to my host server) for both the file and the cgi-bin directory where the upload.cgi file resides
    2) I changed the first line in the .cgi file to reflect the location which is /usr/bin/perl

    And now I'm getting a "500 Internet Server Error" (Its that better than 404 :-). My .htm file doesn't have to be in the same directory if I used the absolute path in the .cgi file does it?

    Thx for your patience!

    - HiTekMom

  6. #6
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    Is 755 what the documentation for the script said? 755 does not allow the script to write to folders (thus not allowing users to upload files). Do you have a link to the script you used?

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  7. #7
    Join Date
    Jun 2003
    Posts
    28
    Here's the link to the script:
    http://swankyscripts.com/scripts.php?page=perluploader
    Unfortunately the free script doesn't come with docs. The paying script does.

    When I tried to set the CHMOD to 766 for the .cgi file resets itself to 733 and when CHMOD to 777 it resets to 717

    Is this a host problem?

    - HiTekMom

  8. #8
    Join Date
    Dec 2002
    Location
    High on life
    Posts
    10,104
    You need to CHMOD the directory that the script trys to upload to. The directory set it this line:

    open (UPLOAD, ">../path/to/upload/dirctory") || Error ();

    Set that to 777

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!

  9. #9
    Join Date
    Jun 2003
    Posts
    28
    I'm sorry. I'm sure it's me - - I just don't get it. But, I'm not giving in. It's new, but I love it. Here's what I did:

    I changed the
    open (UPLOAD, ">../path/to/upload/dirctory") || Error ();

    to read
    open (UPLOAD, ">../home/client") || Error ();

    then I tried to CHMOD that directory (the dir where the files are to reside after uploading) to 777 but it didn't take. The dir CHMOD to 717 automatically.

    Is this a permission problem bwt the Host and myself?

    If not, should I try a different script?

    I really appreciate your time and expertise!!!!!

  10. #10
    Join Date
    Jun 2003
    Posts
    28
    Pyro,

    I may have been using the wrong directory on my server. As I reread the server docs there is a dir that allows external anonymous ftp access to up/download.

    I'm going to move my .htm file there and see if I can CHMOD that directory to 777.

    You're the best!!!!!!!!!!!!

  11. #11
    Join Date
    Nov 2002
    Location
    NY, USA
    Posts
    731
    Add this to the program code
    Code:
    use CGI::Carp 'fatalsToBrowser';
    This will give you the real error. Knowing what the problem is helps tremendously in finding the solution.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  12. #12
    Join Date
    Jun 2003
    Posts
    28
    Well, I've tried the host server ftp:../public_html/incoming but that didn't work.

    Pyro do you agree to Jeff's post?

    No offense Jeff. I'm trying alot of stuff. I'm sure I'll try the fatalsToBrowser -- I'm just not familiar with what the outcome will be.

  13. #13
    Join Date
    Jun 2003
    Posts
    28
    Okay! I determine.

    Jeff: Do I place the line anywhere in the .cgi script?

  14. #14
    Join Date
    Nov 2002
    Location
    NY, USA
    Posts
    731
    Jeff: Do I place the line anywhere in the .cgi script?
    Yes, it can go just about anywhere. But is customarily put near the top.
    I'm just not familiar with what the outcome will be
    It will replace the "500 Internal Server Error" message with the error message generated by Perl.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  15. #15
    Join Date
    Jun 2003
    Posts
    28
    Good morning Jeff:

    I place the line in the top but am still getting 500 error.

    First, my first line points to the ../cgibin should it point to /usr/bin/perl

    2nd, I cannot CHMOD the dir, to be uploaded to, to 777 or 776, when I do this it automatically changes to 733 or 717, it's currently CHMOD to 755

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles