Til at starte med vil jeg blot fortælle hvad jeg har gjort inden fejlen opstår.
Serveren siden kører på er win2003 med iis 6.0 der er givet modify rettigheder til everyone til mappen c:\php\uploadtemp samt e:\www\servicedesk\attachments
jeg for denne fejl //--- Warning: move_uploaded_file(/servicedesk/attachments/1143215145627_48033769.Image158.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in E:\www\servicedesk\common\common.php on line 2915
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\PHP\uploadtemp\php14.tmp' to '/servicedesk/attachments/1143215145627_48033769.Image158.jpg' in E:\www\servicedesk\common\common.php on line 2915'
nu for jeg denne fejl Warning: move_uploaded_file(/servicedesk/E:\www\servicedesk\attachments/1143225540397_21061.jpg) [function.move-uploaded-file]: failed to open stream: Invalid argument in E:\www\servicedesk\common\common.php on line 2915
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\PHP\uploadtemp\php17.tmp' to '/servicedesk/E:\www\servicedesk\attachments/1143225540397_21061.jpg' in E:\www\servicedesk\common\common.php on line 2915
* uploadAttachment takes 3 arguments - $max_attachment_size, $_form_field_name * and $time and uses the global variable $file_upload_directory . It takes files * uploaded using the POST method, adds them to the upload directory .FileNames * are appended with epoch time ($time) and an underscore to confirm uniqueness, * and whitespaces are replaced with underscores for filesystem and browser * compliance. $new_filename is returned with epoch time appended. */ function uploadAttachment($max_attachment_size, $form_field_name, $time) {
global $file_upload_directory, $compress_attachments;
//Lets fix up whitespace re linux and browser incompatibilities $new_filename= preg_replace('/[^a-zA-Z0-9\.\$\%\'\`\-\@\{\}\~\!\#\(\)\&\_\^]/', '', str_replace(array (' ', '%20', '\'', '"'), array ('_', '_', '_', '_'), $_FILES[$form_field_name]['name'])); $uploadfile= $file_upload_directory.$time.'_'.$new_filename;
//If no error exists lets go (0 means OK) if ($file_err == 0) { $result= move_uploaded_file($file_tmp, $uploadfile); if (!$result) { printError('There is a problem moving the uploaded file to '.$file_upload_directory.'. Please check the directory exists and permissions are set as per the install documentation.'); die; } } else { // Delete temp file if any, and display errors. if ($file_tmp != '') { unlink($file_tmp); } switch ($file_err) { case '1' : printError('Attachment '.$filename.' exceeds the maximum allowed file size as set in php.ini. '.'Please contact your system admin.'); die; break; case '2' : printError('Attachment '.$filename.' exceeds the maximum allowed file size as set in your '.'webserver configuration file. Please contact your system admin.'); die; break; case '3' : printError('The file was only partially uploaded. This could be the result of your connection '.'being dropped in the middle of the upload.'); die; case '4' : printError('You did not upload anything... Please go back and select a file to upload.'); die; break; case '5' : printError('The file is 0 kilobytes in length. Is it an empty file?'); break; die; } } //return new filename return $time.'_'.$new_filename; //compress our attachment if we have enabled it // if ($compress_attachments == "Off"){ // //return new filename // return $time.'_'.$new_filename; // }else{ // compressAttachment($uploadfile, $uploadfile.'.gz'); // return $time.'_'.$new_filename.'.gz'; // } }
$max_attachment_size = 16 mb $_form_field_name = filens navn ! $file_upload_directory = e:\www\servicedesk\attachments -- stod før til blot attachments
løste problemet via at sætte server_root ind i en fil. programmet kunne ikke finde ud af server root på min win2003 server
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.