vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   uploading images (https://vborg.vbsupport.ru/showthread.php?t=49572)

N!ck 03-03-2003 01:42 AM

uploading images
 
Following is part of a script I'm working on to upload pictures. I'm getting an error that no file was uploaded, but this is just not the case. I double-checked that I have the attribute on my form tag (enctype="multipart/form-data"), and I also made sure that the name of the file field was correct.

Does anyone see anything that might be causing the problem?

PHP Code:

...
if (
$action=="upload") {
  if (
$bbuserinfo[userid]=="0" or $bbuserinfo[userid]=="") {
    
show_nopermission();
    exit;
  }
  if (empty(
$picfile)) {
    eval(
"standarderror(\"".gettemplate("error_gallery_nopic")."\");");
    exit;
  }
  
$filename=str_replace(" ","_",$picfile_name);
  
$targetname=$gallerypath."/photos/".$bbuserinfo[userid]."/".$filename;
  
$targetthumb=$gallerypath."/thumbs/".$bbuserinfo[userid]."/".$filename;
  if (
file_exists($targetname) or file_exists($targetthumb)) {
    eval(
"standarderror(\"".gettemplate("error_gallery_filename")."\");");
    exit;
  }
... 


N!ck 03-03-2003 01:50 AM

Also note, there is no value set for the uploads tmp dir in my phpinfo...any way to use my own tmp folder?

filburt1 03-04-2003 01:37 PM

A really long PHP uploads tutorial: http://www.webdesignforums.net/thread1873.html

Remember you have to copy the temp file before the page is done executing, otherwise it will be nuked. And yes, I do believe you need to set an upload destination in your php.ini.

N!ck 03-04-2003 09:25 PM

Thanks filburt. I've done some work on it and got it *almost* working. That particular problem is fixed. :)


All times are GMT. The time now is 04:27 PM.

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.01456 seconds
  • Memory Usage 1,720KB
  • 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
  • (4)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