SitePoint Sponsor

User Tag List

Page 3 of 8 FirstFirst 1234567 ... LastLast
Results 51 to 75 of 181
  1. #51
    Anonymous
    SitePoint Community Guest
    great!!! at last I could get a nice explanation about an upload file.
    Could you explain another example, but using size control over the upload file and other restrictions? thanks a lot!

  2. #52
    Rudolph Scott
    SitePoint Community Guest
    Tried this. upload.cgi won't load but if I rename file to upload.pl it runs. Only thing is no picture appears in upload directory and pic also does not appear on the web page. Any ideas? r.scott@iop.kcl.ac.uk

  3. #53
    Tom
    SitePoint Community Guest
    I have a similar problem. Nothing seems to be uploaded. I'm running FreebSD 5.3 (RELEASE) with perl 5.8.5 if that helps.

  4. #54
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could be a permissions problem maybe? Make sure the webserver user has permission to create files in your "upload" directory. Also check that the path to the "upload" directory as specified in your script is correct.

    Matt

  5. #55
    tom
    SitePoint Community Guest
    1) use the following as the first line of the
    upload.cgi script:
    #!/usr/bin/perl
    2) I use the temp directory for my
    file-dir/file-name...
    $upload_dir = "/temp/"

  6. #56
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tom

    Your $upload_dir should probably include the path to your web site from the volume root, eg:

    $upload_dir = "/var/www/html/temp/"

    Make sure the "temp" folder is writable by your webserver user too.

    Matt

  7. #57
    Matt Gideon
    SitePoint Community Guest
    I see to be having a problem with the CGI file - everything appears to be acurate, but when clicking on the submit button - it closk then gives me a "the document contains no data" error - can you help? here is a link to the test upload page: http://www.god-song.com/eupload.html

  8. #58
    SitePoint Member
    Join Date
    Sep 2005
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    plz can you help? when i click submit this comes up:
    The specified CGI application misbehaved by not returning a complete set of HTTP headers.

    what does this mean?

  9. #59
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Matt Gideon
    I see to be having a problem with the CGI file - everything appears to be acurate, but when clicking on the submit button - it closk then gives me a "the document contains no data" error - can you help? here is a link to the test upload page: http://www.god-song.com/eupload.html
    When I tried uploading a file at your site I got the error:

    Code:
    CGI open of tmpfile: Permission denied
    Looks like your server's CGI.pm isn't set up with a temp directory that it can dump its temp files into. Look for the section "You can read the name of the uploaded file, but can't retrieve the data" http://stein.cshl.org/WWW/CGI/ for some pointers.

    Hope that helps

    Cheers,
    Matt

  10. #60
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by danielle1
    plz can you help? when i click submit this comes up:
    The specified CGI application misbehaved by not returning a complete set of HTTP headers.

    what does this mean?
    It means that your script isn't running correctly (usually because it has an error). Make sure you have specified the correct path to your upload folder, and also set the permissions for the folder correctly.

    You can also find general troubleshooting info in our Troubleshooting CGI Scripts tutorial.

    Cheers,
    Matt

  11. #61
    Anonymous
    SitePoint Community Guest
    I got INTERNAL SERVER ERROR even though I have checked the URLs, Paths, and the permissions. Any other suggesstions on this??

  12. #62
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anonymous
    I got INTERNAL SERVER ERROR even though I have checked the URLs, Paths, and the permissions. Any other suggesstions on this??
    Can you install/run other Perl CGI scripts on your site without problems?

    At what point do you get an internal server error?

    Also, you could try ELATED's Troubleshooting CGI Scripts tutorial, which explains how to narrow down internal server error problems.

    Cheers,
    Matt

  13. #63
    Tom
    SitePoint Community Guest
    If you're running on a unix box, try running perl -cwT /whatever/the/file's/path/is - that should tell you any errors. Alternatively, add "use CGI::Carp qw(warningsToBrowser fatalsToBrowser);" underneath the use CGI (without the inverted commas) - this tells you what the error is when you load your page (but it doesn't show as many errors as the first method) - you'll want to remove the line before publishing your site though... it could show hackers potential weaknesses...

  14. #64
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great idea to use CGI::Carp, Tom - hadn't thought of that

    Matt

  15. #65
    Anonymous
    SitePoint Community Guest
    this page its really good

  16. #66
    Ger
    SitePoint Community Guest
    Thanks very much. A very well written doc.
    Should also add that the webserver must have write access to the upload directory.

  17. #67
    Zousug
    SitePoint Community Guest
    Hello,

    Im looking at useing this on my site but i have a questions.

    whats the size limit for the files (i need away so that users can upload files bigger then 2mb in size (IE's file size limit))

    thank you.

  18. #68
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AFAIK IE doesn't have an upload file size limit.

    To set a limit server-side, use CGI.pm's $CGI::POST_MAX variable. See http://search.cpan.org/~lds/CGI.pm-3...ervice_Attacks for details. I believe the default behaviour is to have no limit.

    Cheers
    Matt

  19. #69
    groden
    SitePoint Community Guest
    You might wish to add that if using apache under unix a 'chmod apache scriptname' command will be needed to allow the script to run correctly.

  20. #70
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you mean 'chown apache scriptname' ?

    It depends on your server setup really. If you're on a shared host then you probably don't have the required permission to chown.

    Usually 'chmod 755 scriptname' will do the job.

    Cheers
    Matt

  21. #71
    Sean
    SitePoint Community Guest
    I was wondering if anyone got this script working in OS X Server 10.4?

    After I click submit the script brings me to the error page, rather than outputing the HTML in the end of script

  22. #72
    austin
    SitePoint Community Guest
    hi, Is there a way to append the uploaded photo to an existing page of photos? rather a novice at cgi, if it's possible ?

  23. #73
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sean
    I was wondering if anyone got this script working in OS X Server 10.4?

    After I click submit the script brings me to the error page, rather than outputing the HTML in the end of script
    What's the exact error message that you're getting? (Take a look in your web server's error log.)

    Cheers,
    Matt

  24. #74
    SitePoint Zealot elated's Avatar
    Join Date
    Dec 2004
    Location
    Sydney, Australia
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by austin
    hi, Is there a way to append the uploaded photo to an existing page of photos? rather a novice at cgi, if it's possible ?
    Yes, you could extend the script so that each time an image is uploaded, the corresponding img tag is added to the page in question. Put marker comments in the page such as:

    Code:
    <!-- BEGIN IMAGES -->
    .
    .
    .
    <!-- END IMAGES -->
    Your Perl script can then look for the <!-- END IMAGES --> marker and insert the new img tag just before it.

    There's a tutorial on our site that explains how to write to files in Perl.

    Cheers,
    Matt

  25. #75
    Stephen
    SitePoint Community Guest
    I pretty much just copied and pasted your code into Notepad and saved the files as instructed, then uploaded them to the correct locations and changed permissions. Trying it out, I get an internal server error. I checked my log, and it says "Premature end of script headers" What does that mean? I'm completely ignorant when it comes to Perl/CGI scripting.


Bookmarks

Posting Permissions

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