Changeset 434
- Timestamp:
- 10/08/2003 05:28:25 PM (23 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/b2upload.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/b2upload.php
r399 r434 13 13 ?><html> 14 14 <head> 15 <title> b2 >upload images/files</title>15 <title>WordPress :: upload images/files</title> 16 16 <link rel="stylesheet" href="<?php echo $b2inc; ?>/b2.css" type="text/css"> 17 17 <style type="text/css"> … … 167 167 $i = explode(" ",$fileupload_allowedtypes); 168 168 $i = implode(", ",array_slice($i, 1, count($i)-2)); 169 move_uploaded_file($img1, $pathtofile2) 170 or die("Couldn't Upload Your File to $pathtofile2."); 169 $moved = move_uploaded_file($img1, $pathtofile2); 170 // if move_uploaded_file() fails, try copy() 171 if (!$moved) { 172 $moved = copy($img1, $pathtofile2); 173 } 174 if (!$moved) 175 die("Couldn't Upload Your File to $pathtofile2."); 171 176 172 177 // duplicate-renaming function contributed by Gary Lawrence Murphy … … 197 202 198 203 if (!strlen($imgalt)) { 199 move_uploaded_file($img1, $pathtofile) //Path to your images directory, chmod the dir to 777 200 or die("Couldn't Upload Your File to $pathtofile."); 204 @$moved = move_uploaded_file($img1, $pathtofile); //Path to your images directory, chmod the dir to 777 205 // move_uploaded_file() can fail if open_basedir in PHP.INI doesn't 206 // include your tmp directory. Try copy instead? 207 if(!moved) { 208 $moved = copy($img1, $pathtofile); 209 } 210 // Still couldn't get it. Give up. 211 if (!moved) 212 die("Couldn't Upload Your File to $pathtofile."); 201 213 } else { 202 214 rename($img1, $pathtofile)
Note: See TracChangeset
for help on using the changeset viewer.