Jump to content


Photo

Up loading files


  • Please log in to reply
1 reply to this topic

#1 arthur1972

arthur1972
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 02 June 2006 - 12:34 PM

I think I have a couple of errors here. open_basedir may be the least of them. I think it may be trying to write the file I am trying to upload back to my own computer. any help would be much apreciated.


*********************************************************************
Warning: copy(): open_basedir restriction in effect. File(/home/www/scripts/software/id2_m3u.shtml 2.zip) is not within the allowed path(s): (/home/thottmod:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/thottmod/public_html/submit.php on line 216

Warning: copy(/home/www/scripts/software/id2_m3u.shtml 2.zip): failed to open stream: Operation not permitted in /home/thottmod/public_html/submit.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/thottmod/public_html/submit.php:216) in /home/thottmod/public_html/submit.php on line 292
*********************************************************************

this is the line of code the error message is refering to
********************************************************************
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
copy($_FILES['userfile']['tmp_name'], $software_upload_path.$next_script_id.$_FILES['userfile']['name']);
$flddownload_url = $software_download_path.$next_script_id.$_FILES['userfile']['name'];
}
*********************************************************************

I don't think the form has erros in it but here is the code that the above is referring
*********************************************************************
<td colspan="2"><font class="CommentFont">file should be some kind of archives (e.g. zip, tar.gz etc.), size of archive should be less than 200kb. we do not allow to upload any executable (exe,com etc.) files</font></td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td width="250" class=HeaderColor><font class="TitleColor">Home Site** http://</font></td>
<td><input type="text" name="site_url" maxlength="255" value="{site_url}" size="50"></td>
*********************************************************************
Thanks for any help
Arthur

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 02 June 2006 - 02:02 PM

To handle uploaded files, I'd use move_uploaded_file:
[a href=\"http://www.php.net/move_uploaded_file\" target=\"_blank\"]http://www.php.net/move_uploaded_file[/a]

bool move_uploaded_file ( string filename, string destination )

~ D Kuang




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users