This is the fourth document of the system. Upload.php is primarily responsible for the verification of filename
, uploading file and file address archive
if ($i >0)
Echo ("<font color=red> Sorry, the file name you want to upload already exists,<br> system automatically renamed it". $filename. " </font> ");
Check Rationality end
if (!copy ($upfile, $uploadto. $filename)) Die ("
Write file list
$fileurl = $uploadto. $filename//File URL
$flists = $uploadto. $col. " LST ";//File list location
for ($i =0; $i <100 &&!file_exists ($flists); $i + +);
if ($i ==99) {
Unlink ($uploadto. $filename);
Die ("System error". $goback);
}
Copy ($flists, $flists. " Bak ");
if (! $fp =fopen ($flists, "R")) {
Unlink ($uploadto. $filename);
Die ("error". $goback);
}
$filerc =explode (">", Fread ($fp, FileSize ($flists))/uploaded file
Fclose ($FP);
if (! $fp =fopen ($flists, "w")) {
Unlink ($uploadto. $filename);
Copy ($flists. ". Bak ", $flists);
Die ("error". $goback);
}
Fwrite ($fp, Trim ($newinfo));
Fclose ($FP);
End of Write file list
File transfer
echo "
echo "File in <a href=". $fileurl. " > ". $cgiroot. $fileurl." </a> $goback ";
File Transfer succeeded
?>
</center>
</div>
</body>
This is the last article in this article, mainly describes how to use the system, let us use a case to illustrate:
For example, we want to do the flash work upload vote, then we only need to be in the. /uploadfile/(relative to the system PHP file location) under the subdirectory to build a flash subdirectory, and in which the following files are created: Flash.if (the caption appears when the record is displayed), Flash.ip (vote IP record), FLASH.IPD (download IP record), Flash.lst (download file information record). Then use the View.php?col=flash can use the system, if you want to add columns/user PHP works upload, just in ... /uploadfile/under a separate subdirectory PHP, and the corresponding file, and use view.php?col=php can be used
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.