Jump to content


This topic is now archived and is closed to further replies.


Up loading files

Recommended Posts

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>
<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

Share this post

Link to post
Share on other sites
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]

[code]bool move_uploaded_file ( string filename, string destination )[/code]

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.