upload na fail
1 отговора
123 прегледа
upload na fail
zdraweite
problemyt e sledniq:
prawq upload na fail sys sledniq fragment ot koda:
if($ImageFile2_name){
if (!preg_match("/\.bmp$|\.png$|\.gif$|\.jpg$/i",$ImageFile2_name)){print "nepozwolen tip";}
elseif($ImageFile2_size>$MAX_FILE_SIZE){print "mnogo golqm fail";}
else{
@$res=copy($ImageFile2,"/var/www/html/mitko/users/test/$ImageFile2_name");
if ( !$res ) print "Upload failed! \n";
else {
print "Upload of $ImageFile2_name successful \n";
a formata e:
<FORM name="f3" method="post" action="upload.phtml" enctype="multipart/form-data">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="102400">
<BR>
<INPUT type="file" name="ImageFile2">
no pri zapisa na fajla, koito e kartinka slaga otprede slednoto:
----------
Content-Type: image/pjpeg
яШяа -->towa e ot kartinkata
-------
t.e. dobawq reda s content-type, neobqsnimo za men zachto.
nqkoi znae li rechenie na problema. dostigam do izwoda che e nechto ot nastroikite na php.

problemyt e sledniq:
prawq upload na fail sys sledniq fragment ot koda:
if($ImageFile2_name){
if (!preg_match("/\.bmp$|\.png$|\.gif$|\.jpg$/i",$ImageFile2_name)){print "nepozwolen tip";}
elseif($ImageFile2_size>$MAX_FILE_SIZE){print "mnogo golqm fail";}
else{
@$res=copy($ImageFile2,"/var/www/html/mitko/users/test/$ImageFile2_name");
if ( !$res ) print "Upload failed! \n";
else {
print "Upload of $ImageFile2_name successful \n";
a formata e:
<FORM name="f3" method="post" action="upload.phtml" enctype="multipart/form-data">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="102400">
<BR>
<INPUT type="file" name="ImageFile2">
no pri zapisa na fajla, koito e kartinka slaga otprede slednoto:
----------
Content-Type: image/pjpeg
яШяа -->towa e ot kartinkata
-------
t.e. dobawq reda s content-type, neobqsnimo za men zachto.
nqkoi znae li rechenie na problema. dostigam do izwoda che e nechto ot nastroikite na php.