vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   PHP Upload Issue (https://vborg.vbsupport.ru/showthread.php?t=238518)

TheMayhem 03-17-2010 06:31 PM

PHP Upload Issue
 
I have a file that I am working on for an Admin CP upload of an image. I'm running into a problem on trying to get it to successfully upload the file. Here is my coding:

PHP Code:

    $vbulletin->input->clean_array_gpc('p', array(
        
'name'             => TYPE_STR,
        
'url'               => TYPE_STR,
        
'description'      => TYPE_STR,
        
'type'             => TYPE_INT,
        
'enable'           => TYPE_INT,
    ));

    
$vbulletin->input->clean_gpc('f''image'TYPE_FILE);

     if (
$vbulletin->GPC['image'] == '')
    {
        
print_stop_message('adright_no_image');
    }

    
$dir dirname(__FILE__);
    
$dir .= "/adright/";

    if (!
is_dir($dir)) {
        
print_stop_message('adright_bad_directory');
    } else {
    
$new_file =  $dir .  basename($vbulletin->GPC['image']['name']);
    print 
$new_file;
    if (!
move_uploaded_file($vbulletin->GPC['image']['tmp_name'], $new_file)) {
        die(
'An error has occurred<br />' $vbulletin->GPC['image']['error']);
    }
    } 

The only output I ever get is An error has occurred. The file is never uploaded and it doesn't seem to be grabbing my image file correctly for the upload process. I know the upload image form is working because I never visibly see the phrase related to not entering an image. Any help on where I am going wrong would be greatly appreciated.

speedracer68 05-06-2010 07:23 PM

Bump.

I am the one waiting on this. Please help if you can.


All times are GMT. The time now is 07:32 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00927 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete