View Single Post
ישן 28-04-10, 17:37   # 1
syn
הוסטסניון
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 1,919

syn לא מחובר  

שינוי שם של קובץ בעת העלאה לשרת

אני משתגע, לא יודע כבר מה לעשות, עבדתי עם הקוד הזה אינספור פעמים, ויש אתר אחר שהקוד הזה עובד בו חלק.
אבל משום מה פה זה לא רוצה לעבוד פשוט, זה מטריף אותי..

PHP קוד:
    $size 103// the thumbnail height
    
$filedir 'gallery/'// the directory for the original image
    
$thumbdir 'gallery/'// the directory for the thumbnail image
    
$prefix 'small_'// the prefix to be added to the original name
    
$maxfile '20000000000';
    
$mode '0666';
    
    
$rand rand(0000,9999);
    
    
$userfile_name "$rand_" $_FILES['image1']['name'];

    
$namez $userfile_name;
    
$userfile_tmp "$rand_" $_FILES['image1']['tmp_name'];
    
$userfile_size $_FILES['image1']['size'];
    
$userfile_type $_FILES['image1']['type'];
    if (isset(
$_FILES['image1']['name'])) 
    {
        
$prod_img $filedir.$rand.$userfile_name;
        
$prod_img_thumb $thumbdir.$prefix.$rand.$userfile_name;
        
move_uploaded_file($userfile_tmp$prod_img); 
והבעיה לא רק ברנדום, גם אם לתת לו שם רגיל לא מתחשק לו להשתנות :/
הצילו

ניסיתי אפילו לעשות ככה -
PHP קוד:
move_uploaded_file($userfile_tmp"gallery/123-$userfile_name"); 
וזה פשוט מתעלם מה 123-
מה לעזעזל קורה פה ?

Last edited by syn; 28-04-10 at 17:48..
  Reply With Quote