|
Blue Forest http://www.lslnet.com at 7:58 p.m. on August 11, 2006
|
|
Copy () problem
|
|
$tempfile= "Temp/aaa.zip"; Copy ($userfile, $tempfile)
I stored the file upload data to a folder called temperature But some mainframe can, but it's not certain This message will be : Warning : open_basedir restriction in effect. File is in wrong directory In the end there is a problem? $tempfile Is the problem?
|
|
|
Re : copy () problem
|
|
$tempfile Is a relative of your list to ensure you are in the current catalog Temperature catalog.
|
|
|
Re : copy () problem
|
|
Later, I changed it $tempfile=$userfile_name Will it be deposited in the catalog (p. 277-344), but it has become a Warning : Unable to open 'D:\xxx.zip' for reading : No such file or directory
|
|
|
Re : copy () problem
|
|
Which you upload to the server? This document is not checked, and then check if any craft successfully. You can increase under the following codes :
Echo $_POST[userfile]. "- Users upload to the server name in the paper temporary storage of the" Organization Department Holds Press Conference "; Echo $_POST[userfile_name]. "- User machine, the original name of the document" School Official Cites Use "; Echo $_POST[userfile_size]. "- Posting of documents to the actual byte count" Organization Department Holds Press Conference "; Echo $_POST[userfile_type]. "- If the user's browser to provide this information, it said mime types. For example image/gif<br>\n ";
If you are running PHP on IIS to ensure that your visit to be a list of documents IUSR_< name of your machine, "users open.
|
|
|
Re : copy () problem
|
|
Purchased large : I was abroad test the free space (spacesports.com) Results $_POST[userfile] $_POST[userfile_name] $_POST[userfile_size] $_POST[userfile_type] value (value) are both (none). Why? This does not mean that the file is not with the traditional spirit, Why? Thx~
|
|
|
Re : copy () problem
|
|
Upload.html
"Html> "Head are "Title>Administration - upload new files</title> "/head> "Body> "H1>Upload files</h1> "Form enctype=" multipart/form-data "action=" copyfile.php "method=" post "" "Input type=" hidden "name="_ftn1"" MAX_FILE_SIZE "value=" 2000000 "" Upload this file : "input name="_ftn1"" userfile "type=" file "" "Input type=" submit "value=" Send File, "" "/form> "/body> "/html> ===================
Copyfile.php
"Html> "Head are "Title>update</title> "/head> "Body> "H1>update</h1> <?
Echo "userfile :." $userfile. "" BR> "; Echo "name :." $userfile_name. "" BR> "; Echo ": size." $userfile_size. "" BR> "; Echo "type :." $userfile_type. "" BR> ";
If ($userfile_type ====== "text/html") ( Echo "ERROR : Please do not upload text files types"; Exit; }
Echo "upload. . . "Organization Department Holds Press Conference"; If ($userfile> "none") (
4003rd files pending under the temp/ $tempfile = $userfile_name;
If (!copy ($userfile, $tempfile)) {
Echo "ERROR : could not duplicating the files"; Exit; }
Echo "success";
}
?>
"/body> "/html> ========================================
The same thing on a mainframe could not use the results of a why ????help~ Spacesports Http://cgi-bin.spaceports.com/~danny/test/upload.html
4ever Http://4ever.idv.tw/~daniel/test/upload.html
|
|
|
Re : copy () problem
|
|
If $tempfile= "temp/aaa.zip"; Contents should pay attention to two points : One is a TEMPEST catalog, the catalog is the authority for 1777. You can use power tools such as the CUTEFTP. Another is how you $ftempfile= "aa.zip", the authority for the current list of 777, but in general it is not possible, no security to speak of your list. The first method is used so that your authority as the list of 777 TEMPEST good. It was also very important, after posting documents on the Linux operating system is the temporary folder, the folder from the upload_tmp_dir decision php.ini, you must also complete this list is the authority Po, some systems may not give you authority as a system in which you can upload. But in other uplink system is not the reason.
|
|
|
Re : copy () problem
|
|
So, if the mainframe php.ini not upload_tmp_dir It will be like Http://cgi-bin.spaceports.com/~danny/test/upload.html
Is not used copy () the There is no other way that will be Upload files?
|
|
|
Re : copy () problem
|
|
Your website you can upload documents to the system and network links. I am also a secret, for the sake of safety considerations, my worst SAFE_MODE PHP, and established upload_tmp_dir=/tmp, located /tmp the owner of my name, the authority of the 777 tmp, so I can upload documents as secret. But others will not be able to upload the files. To others can also upload, I did not do : get the upload_tmp_dir=./tmp that each user as the following tmp public_html list and notify the user of building this tmp catalog, and established the authority of the 777, of course, each user can upload the files. But time is a problem, the paper's owner to upload APACHE, and this is beyond the control of the user disk space that the original account to 20MB each, as the owner of the paper x upload all, the spatial distribution of chaos, therefore, I did not open the purview of ordinary users upload documents, This is no way, we may not have a better solution.
|
|
|
Re : copy () problem
|
|
/tmp Catalog will be the worst since 1777, so that all people can be included in list?
Moreover, when you use PHP learned that you did not use http authentication to the administrator of your user / password entry bars, anything of that sort, PHP running as a user should 64A, is that nobody, or x family. Therefore, we should all have learned from the bar
|
|
|
Re : copy () problem
|
|
If it is SAFE_MODE OFF state, can UPLOAD, but if the state is in SAFE_MODE ON or not Upload. OWNER /TMP because only one owner in SAFE_MODE ON state, the owner will have the right to use the catalog, so only the owner can upload documents. The so-called owner, the owner must UPLOAD TMP catalog. PHP documents like the owner of the same.
|
|
|
WWW.PHP.NET I think you should go and look, it seems not so complicated
|
|
Investigation COPY () function code inside Active
|
|
|
Re : copy () problem
|
|
My PHP version 4.3 Programs are as follows :
<?
If ($upload) : $cp=copy ($upfile That. " /a.jpg "); If ($cp) print "upload succeeded the"; Else print "upload fail." Print $upfile_name. ' "School Official Cites Use'. $upfile_type. ' "School Official Cites Use'. $upfile_size; Else : ?>
"Form enctype=" multipart/form-data "action=test.php method=post> "Input type=file name=upfile> "Input type=submit name=upload value= Upload" "/form> <?
Endif; ?>
Upload after a.jpg can do, but the paper size is wrong, can show that it is not this version of the PHP does not support copy (), or in translation when necessary to amend certain parameters, because I tested under Windows when no problem, I have another server would have no problem.
|
|
|
Re : copy () problem
|
|
The wrong, there $_FILES Parameter File Upload array Lane
|
|
|
Re : copy () problem
|
|
Designated as a service where you open_basedir choice, and you have all the documents to operate only in the implementation of this catalog, if you upload a document, you can use move_uploaded_file function, the function not open_basedir restrictions But mobile uplink limited to the paper.
|
|
|
Re : copy () problem
|
|
1 array using $_FILES 2 use move_uploaded_file () posting of documents
Http://www.php.net/manual/en/function.move-uploaded-file.php
|
|
|
Re : copy () problem
|
|
Oh, the problem has been resolved, the original problem is PHP one, I downloaded the latest to snaps.php.net (5.0dev) re-translation, which is set under the Kazakh Ha!
|
|