Old 20-12-2004, 12:56   #1 (permalink)
mid-ori
Senior Member
 
mid-ori's Avatar
 
Join Date: Oct 2003
Posts: 162
PHP uploader problem

Hi,

I trying to use this php uploader, it did work untill i moved some stuff around on the server now its bloody stopped. Can somebody have a look and see if they can see the problem.

i get this error message, line 19 is ("$file_dir/{$file_array[name]}") or die ("Couldn't copy") :

File Upload Results
path: /tmp/php7FASwf
name: iceni_logo.swf
type: application/x-shockwave-flash
size: 772

Warning: move_uploaded_file(../pdf/iceni_logo.swf): failed to open stream: Permission denied in /home/virtual/site443/fst/var/www/html/avideditor/login/uploader.php on line 19

Warning: move_uploaded_file(): Unable to move '/tmp/php7FASwf' to '../pdf/iceni_logo.swf' in /home/virtual/site443/fst/var/www/html/avideditor/login/uploader.php on line 19
Couldn't copy

PHP Code:
<?php
$file_dir 
"../pdf";

foreach(
$_FILES as $file_name => $file_array) {
    echo 
"path: ".$file_array['tmp_name']."<br>\n";
    echo 
"name: ".$file_array['name']."<br>\n";
    echo 
"type: ".$file_array['type']."<br>\n";
    echo 
"size: ".$file_array['size']."<br>\n";

    if (
is_uploaded_file($file_array['tmp_name'])) {
        
move_uploaded_file($file_array['tmp_name'],
"$file_dir/{$file_array[name]}") or die ("Couldn't copy");
        echo 
"file was moved!<br><br>";
    }
}
?>


HTML Code:
<form action="uploader.php" enctype="multipart/form-data" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="30000000"> <p><strong>File to Upload:</strong> <input type="file" name="fileupload" class="boxtext"></p> <p><input type="submit" class="boxtext" value="Upload"></p> </form>
  Reply With Quote
Old 20-12-2004, 13:01   #2 (permalink)
cam
vague™
 
cam's Avatar
 
Join Date: Mar 2004
Location: Glasgow
Posts: 5,595
check the permission levels on the server for the folders in question - "tmp" and "pdf" to ensure they are read/write enabled
__________________
  Reply With Quote
Old 20-12-2004, 13:04   #3 (permalink)
mid-ori
Senior Member
 
mid-ori's Avatar
 
Join Date: Oct 2003
Posts: 162
cheers, i forgot about the damn CHMOD. All working fine now.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8