helloo all!
I'm trying to get my upload code working. I'm not sure whats wrong with it and I can't debut at all!!!!!! This script is being hosted on a shared server--heres the deal. When I delete the following block of coding, the script runs fine (adds to database, prints successful html msg, etc). BUT, when I add the following code, all it does is SHOW BLANK on the browser, leaving me clueless on what the error/problem is? Since this is a shared server, I created a directory thats chmod'ed to 777.
my $fhx = $INPUT->upload('file_name');
my ($Bytes, $Buffer);
open OUTPUT, '>'."/home/gambler_add/adpics/testing.gif" or die "Ca
+n't open: $!";
while ($Bytes = read($fhx, $Buffer,1024)) {
print OUTPUT $Buffer;
}
close OUTPUT or die "Can't close: $!";
#After this coding, I have more coding that adds form values into a db
+.
I am using strict and warnings and taint. Also using CGI and the object name is $INPUT.
I do have the proper html form coding---(enctype="multipart/form-data")
Its a Linux machine so pretty sure its not because I left out binmode.
I can't seem to figure out whats wrong?
I do have CGI upload enabled and the max post is well beyond the size of file I'm trying to upload.
Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.