Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Move Uploaded Files To Permanent Directory
How To Move Uploaded Files To Permanent Directory? - PHP Script Tips - Uploading Files to Web Servers
✍: FYIcenter.com
PHP stores uploaded files in a temporary directory with temporary file names. You must move uploaded files to a permanent directory, if you want to keep them permanently. PHP offers the move_uploaded_file() to help you moving uploaded files. The example script, processing_uploaded_files.php, below shows a good example:
<?php
$file = '\fyicenter\images\fyicenter.logo';
print("<pre>\n");
move_uploaded_file($_FILES['fyicenter_logo']['tmp_name'], $file);
print("File uploaded: ".$file."\n");
print("</pre>\n");
?>
Note that you need to change the permanent directory, "\fyicenter\images\", used in this script to something else on your Web server. If your Web server is provided by a Web hosting company, you may need to ask them which directories you can use to store files.
If you copy both scripts, logo_upload.php and processing_uploaded_files.php, to your Web server, you can try them to upload an image file to your Web server.
2007-04-19, 5201👍, 0💬
Popular Posts:
Describe different elements in Static Chart diagrams ? Package: - It logically groups element of a U...
.NET INTERVIEW QUESTIONS - Did VB6 support multi-threading ? While VB6 supports multiple single-thre...
What are the five levels in CMMI? There are five levels of the CMM. According to the SEI, Level 1 – ...
What Is a TD Tag/Element? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells A "td" elemen...
What is the difference between delegate and events? ã Actually events use delegates in bottom. But ...