Current location: Hot Scripts Forums » Programming Languages » PHP » PHP Triad/Upload form


PHP Triad/Upload form

Reply
  #1 (permalink)  
Old 10-03-03, 01:26 AM
eddyvlad eddyvlad is offline
Wannabe Coder
 
Join Date: Sep 2003
Location: In The Bloody Pits Of Hell
Posts: 160
Thanks: 2
Thanked 0 Times in 0 Posts
PHP Triad/Upload form

I'm using PHP Triad 2.2.1 and image upload script won't work.
Can anyone who's using PHP triad help me make a simple upload script that work in PHP triad? I don't need the form. Just the code if($submit){...
Perhaps this would help. Can you modify it to work in PHP Triad?

PHP Code:

<?PHP

if(isset( $Submit )) 


if (
$_FILES['imagefile']['type'] == "image/gif"){ 
        

    
copy ($_FILES['imagefile']['tmp_name'], "files/".$_FILES['imagefile']['name']) 
    or die (
"Could not copy"); 

        echo 
""
        echo 
"Name: ".$_FILES['imagefile']['name'].""
        echo 
"Size: ".$_FILES['imagefile']['size'].""
        echo 
"Type: ".$_FILES['imagefile']['type'].""
        echo 
"Copy Done...."
        } 


        else { 
            echo 
""
            echo 
"Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")"
        } 




?>
Thanks anyone who help.

Last edited by eddyvlad; 10-03-03 at 01:45 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-03-03, 11:25 AM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by eddyvlad
and image upload script won't work.
What 'wont work' ? Is an error message displayed ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-03-03, 03:24 PM
eddyvlad eddyvlad is offline
Wannabe Coder
 
Join Date: Sep 2003
Location: In The Bloody Pits Of Hell
Posts: 160
Thanks: 2
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by YourPHPPro
What 'wont work' ? Is an error message displayed ?
There's not error message. The file just won't upload.
It return 0byte. So.. No file were uploaded.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-03-03, 03:43 PM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by eddyvlad
There's not error message. The file just won't upload.
It return 0byte. So.. No file were uploaded.
Does $_FILES['userfile']['error'] show anything ?

What about the error/access logs for the web server ?

What does print_r($_FILES); show ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-06-03, 11:39 AM
eddyvlad eddyvlad is offline
Wannabe Coder
 
Join Date: Sep 2003
Location: In The Bloody Pits Of Hell
Posts: 160
Thanks: 2
Thanked 0 Times in 0 Posts
It shows this...
Array ( [imagefile] => Array ( [name] => The Ring.gif [type] => [tmp_name] => [error] => 2 [size] => 0 ) )

It always return Could Not Copy, Wrong Filetype (my-image.jpg)2
No matter what type of file I tried uploading.

Last edited by eddyvlad; 10-06-03 at 11:51 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 10-06-03, 12:00 PM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by eddyvlad
[error] => 2
http://www.php.net/manual/en/feature...oad.errors.php

Value: 2; The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 10-07-03, 12:17 AM
eddyvlad eddyvlad is offline
Wannabe Coder
 
Join Date: Sep 2003
Location: In The Bloody Pits Of Hell
Posts: 160
Thanks: 2
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by YourPHPPro
http://www.php.net/manual/en/feature...oad.errors.php

Value: 2; The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.
Ohh.... Thanks guys!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 03:22 AM
SQL database registration form help vinhkhuong PHP 3 10-10-03 04:49 AM
I need help with my first php script NeverMind PHP 4 08-01-03 02:27 PM
php registration form al_ghamdi Script Requests 0 07-11-03 04:13 PM
PHP help ! Submit the form kevin PHP 1 06-24-03 09:09 AM


All times are GMT -5. The time now is 12:15 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.