Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Please Help with error!
Old 11-19-2009, 11:14 PM Please Help with error!
Junior Talker

Posts: 4
Trades: 0
I am using a wordpress photo gallery plugin and I am receiving the following error when I upload a photo.

Warning: getimagesize() [function.getimagesize]: Filename cannot be empty in /home/******/public_html/alr/wp-content/plugins/wp-photo-album/wppa.php on line 651



The .php file info is below.
PHP Code:
    // check if thumbs dir exists 
    
if (!is_dir($wppa_dir '/thumbs')) {
        
mkdir($wppa_dir '/thumbs');
    }
    
    foreach (
$_FILES as $file) {
[
B][COLOR=Red]Line 651[/COLOR][/B]        if (getimagesize($file['tmp_name'])) {
            
$ext substr(strrchr($file['name'], "."), 1);
        
$query "INSERT INTO " PHOTO_TABLE " (id, album, ext, name, description) VALUES (0, {$_POST['wppa-album']}, '$ext', '{$file['name']}', '')";
            
$wpdb->query($query);
            
//echo $query;
            
$image_id $wpdb->get_var("SELECT LAST_INSERT_ID()");
            
            
$newimage $wppa_dir '/' $image_id '.' $ext;
            
copy($file['tmp_name'], $newimage);

            if (
is_file ($newimage)) {
                
$uploaded_a_file TRUE;
                if (
is_numeric(get_option('wppa_thumbsize'))) {
                    
$thumbsize get_option('wppa_thumbsize');
                } else {
                    
$thumbsize 130;
                }
                
                
wppa_create_thumbnail($newimage$thumbsize'' );
            } 
        }
    }
    
if (
$uploaded_a_file) { echo '<div id="message" class="updated fade"><p><strong>Photos Uploaded.</strong></p></div>'; }


Can someone please tell me how to fix this?

Last edited by chrishirst; 11-20-2009 at 05:34 AM..
DrVPSHosting is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-20-2009, 05:59 AM Re: Please Help with error!
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
[function.getimagesize]: Filename cannot be empty
How is that hard to understand?
you have a call to getimagesize() with an empty parameter.

Maybe you should start by dumping $_FILES to find what you are feeding to getimagesize():
PHP Code:
foreach ($_FILES as $file) {
  if (
getimagesize($file['tmp_name'])) 
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to Please Help with error!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09484 seconds with 12 queries