cvs: phpdoc /kr/features file-upload.xml
| From: | WonHee Hwang | Date: | Wed, 10 Jan 2001 10:46:55 +0000 |
| Subject: | cvs: phpdoc /kr/features file-upload.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969333530@lists.php.net to get a copy of this message | ||
regina Wed Jan 10 02:46:55 2001 EDT
Modified files:
/phpdoc/kr/features file-upload.xml
Log:
Index: phpdoc/kr/features/file-upload.xml diff -u phpdoc/kr/features/file-upload.xml:1.2 phpdoc/kr/features/file-upload.xml:1.3 --- phpdoc/kr/features/file-upload.xml:1.2 Tue Jan 9 03:27:54 2001 +++ phpdoc/kr/features/file-upload.xml Wed Jan 10 02:46:55 2001 @@ -3,22 +3,18 @@ <sect1 id="features.file-upload.post-method"> <title>POST method uploads</title> <simpara> - PHP is capable of receiving file uploads from any RFC-1867 - compliant browser (which includes Netscape Navigator 3 or later, - Microsoft Internet Explorer 3 with a patch from Microsoft, or - later without a patch). This feature lets people upload both text - and binary files. With PHP's authentication and file manipulation - functions, you have full control over who is allowed to upload and - what is to be done with the file once it has been uploaded. + PHPë RFC-1867ì ì§ìíë ë¸ë¼ì°ì ë¡ë¶í° íì¼ì ì ë¡ë ë°ì ì ìë 기ë¥ì´ ìë¤. + ì´ ê¸°ë¥ì ì¬ì©íë©´ Textë¿ ìëë¼ Binaryíì¼ë ì ë¡ëê° ê°ë¥íë¤. + ì¬ë¬ë¶ì PHPì autheticationê³¼ íì¼ì ë¤ë£¨ë í¨ì를 ì¬ì©íì¬, + íì¼ì´ Uploadë íì í´ì¼ í ì¼ì ì¤í¬ë¦½í¸ì ë°ëì ì í´ ëì´ì¼ íë¤. </simpara> <para> - Note that PHP also supports PUT-method file uploads as used by - Netscape Composer and W3C's Amaya clients. See the <link linkend="features.file-upload.put-method">PUT Method - Support</link> for more details. + PHPë ëí Netscape Composer ì W3C's Amaya clients를 ì¬ì©í ê²½ì° + PUT-method ì íì¼ ì ë¡ëë ì§ìíë¤. ìì¸í ë´ì©ì + <link linkend="features.file-upload.put-method">PUT Method Support</link>를 ì½ì´ë³´ê¸°ë°ëë¤. </para> <para> - A file upload screen can be built by creating a special form which - looks something like this: + íì¼ ì ë¡ë íë©´ì ë¤ìê³¼ ê°ì ì¢ í¹ë³í í¼ì ë§ë¤ì´ ëì¸ ì ìë¤. : <example> <title>File Upload Form</title> <programlisting> @@ -29,9 +25,9 @@ </FORM> </programlisting> </example> - The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden - field must precede the file input field and its value is the - maximum filesize accepted. The value is in bytes. + ì¬ê¸°ì _URL_ì PHP htmlíì¼ì´ì´ì¼ í©ëë¤. + hidden íëì¸ MAX_FILE_SIZEë File input íëë¤ë³´ë¤ ì íëì´ì¼ í©ëë¤. + ì´ ê°ì PHP htmlì´ ë°ìë¤ì´ë ìµë íì¼ í¬ê¸°ë¥¼ Byteë¨ìë¡ ëíë ëë¤. </para> <para> In PHP 3, the following variables will be defined within the @@ -45,36 +41,31 @@ <itemizedlist> <listitem> <simpara> - <varname>$userfile</varname> - The temporary filename in which - the uploaded file was stored on the server machine. + <varname>$userfile</varname> - ì ë¡ëë íì¼ ë´ì©ì´ ì ì¥ëì´ ìë ìë²ì ìì íì¼ëª . </simpara> </listitem> <listitem> <simpara> - <varname>$userfile_name</varname> - The original name or path - of the file on the sender's system. + <varname>$userfile_name</varname> - ì ë¡ëí ìì¤í ìì ì¬ì©íë íì¼ì ìë ì´ë¦. </simpara> </listitem> <listitem> <simpara> - <varname>$userfile_size</varname> - The size of the uploaded - file in bytes. + <varname>$userfile_size</varname> - byteë¨ìì Uploadë íì¼ì í¬ê¸°. </simpara> </listitem> <listitem> <simpara> - <varname>$userfile_type</varname> - The mime type of the file - if the browser provided this information. An example would be - "image/gif". + <varname>$userfile_type</varname> - ë§ì½ browserê° ì ë¡ëë íì¼ì mime íìì ìë¤ë©´, ê·¸ mime íì. + (ì: "image/gif"). </simpara> </listitem> </itemizedlist> - Note that the "$userfile" part of the above variables is - whatever the name of the INPUT field of TYPE=file is in the upload - form. In the above upload form example, we chose to call it - "userfile" + ì ë³ìì "$userfile"ë¶ë¶ì upload formìì TYPE=filedì ê°ì§ INPUT íëì ì´ë¦ì´ ëë¤. + ìì ìì ìì ì°ë¦¬ë ê·¸ ì´ë¦ì "userfile"ì´ë¼ê³ ì íë¤. </para> <para> + In PHP 4, the behaviour is slightly different, in that the new global array <varname>$HTTP_POST_FILES</varname> is provided to contain the uploaded file information. This is still only @@ -133,15 +124,11 @@ </variablelist> </para> <para> - Files will by default be stored in the server's default temporary - directory, unless another location has been given with the <link linkend="ini.upload-tmp-dir">upload_tmp_dir</link> directive in - <filename>php.ini</filename>. The server's default directory can - be changed by setting the environment variable - <envar>TMPDIR</envar> in the environment in which PHP runs. - Setting it using <function>putenv</function> from within a PHP - script will not work. This environment variable can also be used - to make sure that other operations are working on uploaded files, - as well. + ì ë¡ëë Fileì <filename>php.ini</filename>ì + <link linkend="ini.upload-tmp-dir">upload_tmp_dir</link>ì§ììê° í¹ì ëë í 리를 ì§ì íì§ ìì¼ë©´, + 기본ì ì¼ë¡ ì°ì ìë²ì default temporary directoryì ì ì¥ëë¤. + ì´ ëí´í¸ ëë í 리ë PHPê° ëìê°ë ì»´í¨í°ì íê²½ë³ì <envar>TMPDIR</envar>ì ì¤ì íì¬ ë³ê²½í ì ìë¤. + ì´ë¥¼ PHP ì¤í¬ë¦½í¸ ììì <function>putenv</function> í¨ì를 ì¬ì©íì¬ ë³ê²½íë ê²ì ëìíì§ ìëë¤. <example> <title>Validating file uploads</title> <para> @@ -194,51 +181,43 @@ </example> </para> <simpara> - The PHP script which receives the uploaded file should implement - whatever logic is necessary for determining what should be done - with the uploaded file. You can for example use the - <varname>$file_size</varname> variable to throw away any files - that are either too small or too big. You could use the - <varname>$file_type</varname> variable to throw away any files - that didn't match a certain type criteria. Whatever the logic, - you should either delete the file from the temporary directory or - move it elsewhere. + ì ë¡ëë íì¼ì ë¤ë£¨ë PHP ì¤í¬ë¦½í¸ë ê·¸ íì¼ì ë¤ë£¨ë ìì ì ì¤ì í´ ì¤ íìê° ìë¤. + ì를ë¤ì´, ì¬ë¬ë¶ì <varname>$file_size</varname> ë³ì를 ì¬ì©íì¬ ë무 ìê±°ë í° íì¼ì ë²ë¦´ ìë ìë¤. + ëí ì¬ë¬ë¶ì <varname>$file_type</varname> ë³ì를 ê°ì§ê³ í¹ì í íì ì ë§ì§ ìë íì¼ì ë²ë¦´ ì ìë¤. + ì´ë¤ ë¡ì§ì´ë, ì¬ë¬ë¶ì ìì ëë í 리ì ìë íì¼ì ì§ì°ê±°ë ëì¤ì íìí ê²½ì°ìë ë¤ë¥¸ ê³³ì ì´ëìì¼ì¼ íë¤. </simpara> <simpara> - The file will be deleted from the temporary directory at the end - of the request if it has not been moved away or renamed. + ë§ì½ ìì ëë í 리ì ìë íì¼ì í´ë¹ requestê° ëë ë ê¹ì§ë ì§ì°ê±°ë ì´ëìí¤ì§ ììë¤ë©´, + ì´ íì¼ì í´ë¹ requestê° ì¢ ë£ëë ìì ìì ìëì¼ë¡ ì§ìì§ë¤. </simpara> </sect1> <sect1 id="features.file-upload.common-pitfalls"> - <title>Common Pitfalls</title> + <title>ì¼ë°ì ì¸ ì£¼ìì¬í (Common Pitfalls)</title> <simpara> - The MAX_FILE_SIZE item cannot specify a file size greater than the file - size that has been set in the upload_max_filesize in the PHP 3.ini file - or the corresponding php3_upload_max_filesize Apache .conf directive. - The default is 2 Megabytes. + MAX_FILE_SIZE ìì´í ì ê°ì php3.iniì ì¤ì ë upload_max_filesizeì ê°ì´ë + Apacheì .confì ì¤ì í php3_upload_max_filesizeì ê°ë³´ë¤ í¬ê² ì¤ì í ì ìë¤. + 기본ê°ì 2ë©ê° ë°ì´í¸ì´ë¤. </simpara> <simpara> Not validating which file you operate on may mean that users can access sensitive information in other directories. </simpara> <simpara> - Please note that the CERN httpd seems to strip off everything - starting at the first whitespace in the content-type mime header - it gets from the client. As long as this is the case, CERN httpd - will not support the file upload feature. + CERN httpd ìë²ë clientë¡ë¶í° ì ë ¥ë°ì mime headerì ì쪽 ì¬ë°±ì 모ë strip off ìì¼ë²ë¦¬ë¯ë¡, + CERN httpd ìë²ììë File Upload 기ë¥ì´ ëìíì§ ìëë¤. </simpara> </sect1> <sect1 id="feature-fileupload.multiple"> - <title>Uploading multiple files</title> + <title>ì¬ë¬ íì¼ì Uploadí기 (Uploading multiple files)</title> <simpara> - It is possible to upload multiple files simultaneously and have - the information organized automatically in arrays for you. To - do so, you need to use the same array submission syntax in the - HTML form as you do with multiple selects and checkboxes: + íë²ì ì¬ë¬ê°ì íì¼ì ëìì ì ì¡íë ê²ë ê°ë¥íë¤. + ì´ë PHPë ì´ íì¼ë¤ì ëí ì 보를 ë°°ì´ë¡ ì ë¬íë¤. + ë°ë¼ì ì´ë° ê²½ì°ìë ì¬ë¬ê°ë¥¼ ì ííë selectë checkbox ëì²ë¼ HTMLì formì ìì´í ì + ëì¼í arrayëª ì ì ì´ì£¼ì´ì¼ íë¤.: </simpara> <note> <para> - Support for multiple file uploads was added in version 3.0.10. + ì¬ë¬ íì¼ ì ì¡ ê¸°ë¥ì 3.0.10ë¶í° ì¶ê°ë 기ë¥ì´ë¤. </para> </note> <para> @@ -254,26 +233,22 @@ </programlisting> </example> </para> + <simpara> + ìì í¼ì´ ì ì¡ë ë <computeroutput>$userfile</computeroutput>, + <computeroutput>$userfile_name</computeroutput>, + <computeroutput>$userfile_size</computeroutput>ì ë°°ì´ì´ ì ì ë³ìë¡ ë§ë¤ì´ì§ë¤. + ($HTTP_POST_FILES(PHP3 ììë $HTTP_POST_VARS)ìë ë§ë¤ì´ì§ë¤.) + ì´ ë°°ì´ë¤ì ì ì¡ë íì¼ì ì 보를 ê°ì§ê³ ìê³ , ê° ë°°ì´ì ë²í¸ë¡ ì¸ë±ì¤ëì´ ìë¤. + </simpara> <simpara> - When the above form is submitted, the arrays - <computeroutput>$userfile</computeroutput>, - <computeroutput>$userfile_name</computeroutput>, and - <computeroutput>$userfile_size</computeroutput> will be formed in - the global scope (as well as in $HTTP_POST_FILES ($HTTP_POST_VARS - in PHP 3)). Each of these will be a numerically indexed array of - the appropriate values for the submitted files. - </simpara> - <simpara> - For instance, assume that the filenames - <filename>/home/test/review.html</filename> and - <filename>/home/test/xwp.out</filename> are submitted. In this - case, <computeroutput>$userfile_name[0]</computeroutput> would - contain the value <computeroutput>review.html</computeroutput>, - and <computeroutput>$userfile_name[1]</computeroutput> would - contain the value - <computeroutput>xwp.out</computeroutput>. Similarly, - <computeroutput>$userfile_size[0]</computeroutput> would contain - <filename>review.html</filename>'s filesize, and so forth. + ì를 ë¤ì´, ìì ììì <filename>/home/test/review.html</filename>ì + <filename>/home/test/xwp.out</filename> ì ë ê°ì íì¼ì ì ì¡íë¤ë©´ + <computeroutput>$userfile_name[0]</computeroutput> ìë + <computeroutput>review.html</computeroutput>ì´ë¼ë ê°ì´, + <computeroutput>$userfile_name[1]</computeroutput>ìë + <computeroutput>xwp.out</computeroutput>ì´ë¼ë ê°ì´ ì ì¥ëê² ëë¤. + ëìì, <computeroutput>$userfile_size[0]</computeroutput> ìë + <filename>review.html</filename>ì íì¼ í¬ê¸°ê° ì ì¥ëë ìì´ ëë¤ </simpara> <simpara> <computeroutput>$userfile['name'][0]</computeroutput>, @@ -285,9 +260,8 @@ <sect1 id="features.file-upload.put-method"> <title>PUT method support</title> <para> - PHP provides support for the HTTP PUT method used by clients such - as Netscape Composer and W3C Amaya. PUT requests are much simpler - than a file upload and they look something like this: + PHPë Netscape Composerë W3C Amayaê°ì í´ë¼ì´ì¸í¸ì ëí´ HTTP PUT ë°©ì(method)ì ì§ìíë¤. + PUT ì구(request)ë file uploadë³´ë¤ í¨ì¬ ì½ë¤. ë¨ì§ ë¤ìê³¼ ê°ì´ íë©´ ëë¤. : <informalexample> <programlisting> PUT /path/filename.html HTTP/1.1 @@ -295,16 +269,15 @@ </informalexample> </para> <para> - This would normally mean that the remote client would like to save - the content that follows as: /path/filename.html in your web tree. - It is obviously not a good idea for Apache or PHP to automatically - let everybody overwrite any files in your web tree. So, to handle - such a request you have to first tell your web server that you - want a certain PHP script to handle the request. In Apache you do - this with the <emphasis>Script</emphasis> directive. It can be - placed almost anywhere in your Apache configuration file. A - common place is inside a <Directory> block or perhaps inside - a <Virtualhost> block. A line like this would do the trick: + ì´ê²ì ë³´íµ ì격 í´ë¼ì´ì¸í¸ê° ë³´ë¸ ë´ì©ì ì¹ í¸ë¦¬ ë°ì /path/filename.htmlë¡ ì ì¥íë¼ë ì미ì´ë¤. + ê·¸ë°ë° ì¬ë¬ë¶ì ì¹ í¸ë¦¬ë°ì ìë íì¼ë¤ì ì무ë ë®ì´ ì¸ ì ìë¤ë ê²ì + Apacheë PHPì ìì´ì ì¢ì§ ìì ìê°ì´ë¤. + ë°ë¼ì ì´ì ê°ì ì구를 ë¤ë£¨ê¸° ì ì, ì°ì ì¹ ìë²ìê² ì´ë° ì구를 ë¤ë£¨ë + PHP ì¤í¬ë¦½í¸ë¥¼ 미리 ì§ì í´ ì£¼ì´ì¼ íë¤. + ìíì¹ììë <emphasis>Script</emphasis> ì§ììë¡ ê·¸ ë´ì©ì ì§ì íë¤. + ì´ ì§ììë Apache ì¤ì íì¼ì¤ì ì´ë ìì¹ì ìì´ë ê´ì°®ì¼ë, + ë³´íµ <Directory> ë¸ë¡ ìì´ë <Virtualhost> ë¸ë¡ ìì ìì¹íë ê²ì´ ì¼ë°ì ì´ë¤. + ë³´íµ ë¤ìê³¼ ê°ì´ ì¤ì íë¤. : <informalexample> <programlisting> Script PUT /put.php3 @@ -312,13 +285,12 @@ </informalexample> </para> <simpara> - This tells Apache to send all PUT requests for URIs that match the - context in which you put this line to the put.php3 script. This - assumes, of course, that you have PHP enabled for the .php3 - extension and PHP is active. + ì´ê²ì ì´ ë¼ì¸ì´ ìíë ë¸ë¡ì URIì í´ë¹ëë 모ë PUT ì구를 + put.php3 ì¤í¬ë¦½í¸ìê² ì ë¬íë¼ê³ Apacheìê² ìë ¤ ì¤ë¤. + ë¬¼ë¡ ì´ ê²½ì° .php3 íì¥ìì ëíì¬ PHPì¤ì ì´ ìë£ëì´ ìê³ , PHPê° ìëì¤ì´ì´ì¼ íë¤. </simpara> <simpara> - Inside your put.php3 file you would then do something like this: + put.php3 íì¼ì ë³´íµ ë¤ìê³¼ ê°ì´ 구ì±ë ì ìë¤. : </simpara> <para> <informalexample> @@ -328,20 +300,16 @@ </informalexample> </para> <simpara> - This would copy the file to the location requested by the remote - client. You would probably want to perform some checks and/or - authenticate the user before performing this file copy. The only - trick here is that when PHP sees a PUT-method request it stores - the uploaded file in a temporary file just like those handled but - the <link linkend="features.file-upload.post-method">POST-method</link>. - When the request ends, this temporary file is deleted. So, your - PUT handling PHP script has to copy that file somewhere. The - filename of this temporary file is in the $PHP_PUT_FILENAME - variable, and you can see the suggested destination filename in - the $REQUEST_URI (may vary on non-Apache web servers). This - destination filename is the one that the remote client specified. - You do not have to listen to this client. You could, for example, - copy all uploaded files to a special uploads directory. + ìì ëª ë ¹ì í´ë¹ íì¼ì ì격 í´ë¼ì´ì¸í¸ê° ìì²í ìì¹ì ë³µì¬íë ê²ì´ë¤. + ìë§ ì¬ë¬ë¶ì ë³µì¬í기 ì ì ì¬ì©ì를 íì¸íê±°ë íì¼ì ê²ì¬íë ë±ì 기ë¥ì ìí ê²ì´ë¤. + ì¬ê¸°ì ì ì ìë ê²ì PHPê° <link linkend="features.file-upload.post-method">POST-method</link>ì ì구를 ë°ìì ë + POST-method기ë¥ê³¼ ë§ì°¬ê°ì§ë¡ ìì íì¼ì í´ë¹ ë´ì©ì ì ì¥íë¤ë ê²ì´ë¤. + ì¦, ìêµ¬ê° ëëê² ëë©´ ììíì¼ì ì§ìì§ë¤. + ë°ë¼ì PUTì ë¤ë£¨ë PHP ì¤í¬ë¦½í¸ë í´ë¹ íì¼ì ì´ë ë¤ë¥¸ ê³³ì ë³µì¬í´ ëì´ì¼ íë¤. + ììíì¼ì ì´ë¦ì $PHP_PUT_FILENAME ì´ë¼ë ë³ìì ì ì¥ëê³ , + $REQUEST_URI ë³ìì í´ë¼ì´ì¸í¸ìì ë³´ë´ì¨ ì ì¥í íì¼ì ê²½ë¡ì ì´ë¦ì´ ì ì¥ëë¤. + (Apacheê° ìë ì¹ìë²ììë 모ìì´ ì¡°ê¸ ë¬ë¼ì§ë¤.) + ë¬¼ë¡ ì¬ë¬ë¶ì ì´ ê²½ë¡ëª ê³¼ íì¼ëª ì´ ìë ì í ë¤ë¥¸ ìì¹ì ë¤ë¥¸ íì¼ëª ì ì¬ì©í ìë ìë¤. </simpara> </sect1> </chapter>
Index: phpdoc/kr/features/file-upload.xml diff -u phpdoc/kr/features/file-upload.xml:1.2 phpdoc/kr/features/file-upload.xml:1.3 --- phpdoc/kr/features/file-upload.xml:1.2 Tue Jan 9 03:27:54 2001 +++ phpdoc/kr/features/file-upload.xml Wed Jan 10 02:46:55 2001 @@ -3,22 +3,18 @@ <sect1 id="features.file-upload.post-method"> <title>POST method uploads</title> <simpara> - PHP is capable of receiving file uploads from any RFC-1867 - compliant browser (which includes Netscape Navigator 3 or later, - Microsoft Internet Explorer 3 with a patch from Microsoft, or - later without a patch). This feature lets people upload both text - and binary files. With PHP's authentication and file manipulation - functions, you have full control over who is allowed to upload and - what is to be done with the file once it has been uploaded. + PHPë RFC-1867ì ì§ìíë ë¸ë¼ì°ì ë¡ë¶í° íì¼ì ì ë¡ë ë°ì ì ìë 기ë¥ì´ ìë¤. + ì´ ê¸°ë¥ì ì¬ì©íë©´ Textë¿ ìëë¼ Binaryíì¼ë ì ë¡ëê° ê°ë¥íë¤. + ì¬ë¬ë¶ì PHPì autheticationê³¼ íì¼ì ë¤ë£¨ë í¨ì를 ì¬ì©íì¬, + íì¼ì´ Uploadë íì í´ì¼ í ì¼ì ì¤í¬ë¦½í¸ì ë°ëì ì í´ ëì´ì¼ íë¤. </simpara> <para> - Note that PHP also supports PUT-method file uploads as used by - Netscape Composer and W3C's Amaya clients. See the <link linkend="features.file-upload.put-method">PUT Method - Support</link> for more details. + PHPë ëí Netscape Composer ì W3C's Amaya clients를 ì¬ì©í ê²½ì° + PUT-method ì íì¼ ì ë¡ëë ì§ìíë¤. ìì¸í ë´ì©ì + <link linkend="features.file-upload.put-method">PUT Method Support</link>를 ì½ì´ë³´ê¸°ë°ëë¤. </para> <para> - A file upload screen can be built by creating a special form which - looks something like this: + íì¼ ì ë¡ë íë©´ì ë¤ìê³¼ ê°ì ì¢ í¹ë³í í¼ì ë§ë¤ì´ ëì¸ ì ìë¤. : <example> <title>File Upload Form</title> <programlisting> @@ -29,9 +25,9 @@ </FORM> </programlisting> </example> - The _URL_ should point to a PHP file. The MAX_FILE_SIZE hidden - field must precede the file input field and its value is the - maximum filesize accepted. The value is in bytes. + ì¬ê¸°ì _URL_ì PHP htmlíì¼ì´ì´ì¼ í©ëë¤. + hidden íëì¸ MAX_FILE_SIZEë File input íëë¤ë³´ë¤ ì íëì´ì¼ í©ëë¤. + ì´ ê°ì PHP htmlì´ ë°ìë¤ì´ë ìµë íì¼ í¬ê¸°ë¥¼ Byteë¨ìë¡ ëíë ëë¤. </para> <para> In PHP 3, the following variables will be defined within the @@ -45,36 +41,31 @@ <itemizedlist> <listitem> <simpara> - <varname>$userfile</varname> - The temporary filename in which - the uploaded file was stored on the server machine. + <varname>$userfile</varname> - ì ë¡ëë íì¼ ë´ì©ì´ ì ì¥ëì´ ìë ìë²ì ìì íì¼ëª . </simpara> </listitem> <listitem> <simpara> - <varname>$userfile_name</varname> - The original name or path - of the file on the sender's system. + <varname>$userfile_name</varname> - ì ë¡ëí ìì¤í ìì ì¬ì©íë íì¼ì ìë ì´ë¦. </simpara> </listitem> <listitem> <simpara> - <varname>$userfile_size</varname> - The size of the uploaded - file in bytes. + <varname>$userfile_size</varname> - byteë¨ìì Uploadë íì¼ì í¬ê¸°. </simpara> </listitem> <listitem> <simpara> - <varname>$userfile_type</varname> - The mime type of the file - if the browser provided this information. An example would be - "image/gif". + <varname>$userfile_type</varname> - ë§ì½ browserê° ì ë¡ëë íì¼ì mime íìì ìë¤ë©´, ê·¸ mime íì. + (ì: "image/gif"). </simpara> </listitem> </itemizedlist> - Note that the "$userfile" part of the above variables is - whatever the name of the INPUT field of TYPE=file is in the upload - form. In the above upload form example, we chose to call it - "userfile" + ì ë³ìì "$userfile"ë¶ë¶ì upload formìì TYPE=filedì ê°ì§ INPUT íëì ì´ë¦ì´ ëë¤. + ìì ìì ìì ì°ë¦¬ë ê·¸ ì´ë¦ì "userfile"ì´ë¼ê³ ì íë¤. </para> <para> + In PHP 4, the behaviour is slightly different, in that the new global array <varname>$HTTP_POST_FILES</varname> is provided to contain the uploaded file information. This is still only @@ -133,15 +124,11 @@ </variablelist> </para> <para> - Files will by default be stored in the server's default temporary - directory, unless another location has been given with the <link linkend="ini.upload-tmp-dir">upload_tmp_dir</link> directive in - <filename>php.ini</filename>. The server's default directory can - be changed by setting the environment variable - <envar>TMPDIR</envar> in the environment in which PHP runs. - Setting it using <function>putenv</function> from within a PHP - script will not work. This environment variable can also be used - to make sure that other operations are working on uploaded files, - as well. + ì ë¡ëë Fileì <filename>php.ini</filename>ì + <link linkend="ini.upload-tmp-dir">upload_tmp_dir</link>ì§ììê° í¹ì ëë í 리를 ì§ì íì§ ìì¼ë©´, + 기본ì ì¼ë¡ ì°ì ìë²ì default temporary directoryì ì ì¥ëë¤. + ì´ ëí´í¸ ëë í 리ë PHPê° ëìê°ë ì»´í¨í°ì íê²½ë³ì <envar>TMPDIR</envar>ì ì¤ì íì¬ ë³ê²½í ì ìë¤. + ì´ë¥¼ PHP ì¤í¬ë¦½í¸ ììì <function>putenv</function> í¨ì를 ì¬ì©íì¬ ë³ê²½íë ê²ì ëìíì§ ìëë¤. <example> <title>Validating file uploads</title> <para> @@ -194,51 +181,43 @@ </example> </para> <simpara> - The PHP script which receives the uploaded file should implement - whatever logic is necessary for determining what should be done - with the uploaded file. You can for example use the - <varname>$file_size</varname> variable to throw away any files - that are either too small or too big. You could use the - <varname>$file_type</varname> variable to throw away any files - that didn't match a certain type criteria. Whatever the logic, - you should either delete the file from the temporary directory or - move it elsewhere. + ì ë¡ëë íì¼ì ë¤ë£¨ë PHP ì¤í¬ë¦½í¸ë ê·¸ íì¼ì ë¤ë£¨ë ìì ì ì¤ì í´ ì¤ íìê° ìë¤. + ì를ë¤ì´, ì¬ë¬ë¶ì <varname>$file_size</varname> ë³ì를 ì¬ì©íì¬ ë무 ìê±°ë í° íì¼ì ë²ë¦´ ìë ìë¤. + ëí ì¬ë¬ë¶ì <varname>$file_type</varname> ë³ì를 ê°ì§ê³ í¹ì í íì ì ë§ì§ ìë íì¼ì ë²ë¦´ ì ìë¤. + ì´ë¤ ë¡ì§ì´ë, ì¬ë¬ë¶ì ìì ëë í 리ì ìë íì¼ì ì§ì°ê±°ë ëì¤ì íìí ê²½ì°ìë ë¤ë¥¸ ê³³ì ì´ëìì¼ì¼ íë¤. </simpara> <simpara> - The file will be deleted from the temporary directory at the end - of the request if it has not been moved away or renamed. + ë§ì½ ìì ëë í 리ì ìë íì¼ì í´ë¹ requestê° ëë ë ê¹ì§ë ì§ì°ê±°ë ì´ëìí¤ì§ ììë¤ë©´, + ì´ íì¼ì í´ë¹ requestê° ì¢ ë£ëë ìì ìì ìëì¼ë¡ ì§ìì§ë¤. </simpara> </sect1> <sect1 id="features.file-upload.common-pitfalls"> - <title>Common Pitfalls</title> + <title>ì¼ë°ì ì¸ ì£¼ìì¬í (Common Pitfalls)</title> <simpara> - The MAX_FILE_SIZE item cannot specify a file size greater than the file - size that has been set in the upload_max_filesize in the PHP 3.ini file - or the corresponding php3_upload_max_filesize Apache .conf directive. - The default is 2 Megabytes. + MAX_FILE_SIZE ìì´í ì ê°ì php3.iniì ì¤ì ë upload_max_filesizeì ê°ì´ë + Apacheì .confì ì¤ì í php3_upload_max_filesizeì ê°ë³´ë¤ í¬ê² ì¤ì í ì ìë¤. + 기본ê°ì 2ë©ê° ë°ì´í¸ì´ë¤. </simpara> <simpara> Not validating which file you operate on may mean that users can access sensitive information in other directories. </simpara> <simpara> - Please note that the CERN httpd seems to strip off everything - starting at the first whitespace in the content-type mime header - it gets from the client. As long as this is the case, CERN httpd - will not support the file upload feature. + CERN httpd ìë²ë clientë¡ë¶í° ì ë ¥ë°ì mime headerì ì쪽 ì¬ë°±ì 모ë strip off ìì¼ë²ë¦¬ë¯ë¡, + CERN httpd ìë²ììë File Upload 기ë¥ì´ ëìíì§ ìëë¤. </simpara> </sect1> <sect1 id="feature-fileupload.multiple"> - <title>Uploading multiple files</title> + <title>ì¬ë¬ íì¼ì Uploadí기 (Uploading multiple files)</title> <simpara> - It is possible to upload multiple files simultaneously and have - the information organized automatically in arrays for you. To - do so, you need to use the same array submission syntax in the - HTML form as you do with multiple selects and checkboxes: + íë²ì ì¬ë¬ê°ì íì¼ì ëìì ì ì¡íë ê²ë ê°ë¥íë¤. + ì´ë PHPë ì´ íì¼ë¤ì ëí ì 보를 ë°°ì´ë¡ ì ë¬íë¤. + ë°ë¼ì ì´ë° ê²½ì°ìë ì¬ë¬ê°ë¥¼ ì ííë selectë checkbox ëì²ë¼ HTMLì formì ìì´í ì + ëì¼í arrayëª ì ì ì´ì£¼ì´ì¼ íë¤.: </simpara> <note> <para> - Support for multiple file uploads was added in version 3.0.10. + ì¬ë¬ íì¼ ì ì¡ ê¸°ë¥ì 3.0.10ë¶í° ì¶ê°ë 기ë¥ì´ë¤. </para> </note> <para> @@ -254,26 +233,22 @@ </programlisting> </example> </para> + <simpara> + ìì í¼ì´ ì ì¡ë ë <computeroutput>$userfile</computeroutput>, + <computeroutput>$userfile_name</computeroutput>, + <computeroutput>$userfile_size</computeroutput>ì ë°°ì´ì´ ì ì ë³ìë¡ ë§ë¤ì´ì§ë¤. + ($HTTP_POST_FILES(PHP3 ììë $HTTP_POST_VARS)ìë ë§ë¤ì´ì§ë¤.) + ì´ ë°°ì´ë¤ì ì ì¡ë íì¼ì ì 보를 ê°ì§ê³ ìê³ , ê° ë°°ì´ì ë²í¸ë¡ ì¸ë±ì¤ëì´ ìë¤. + </simpara> <simpara> - When the above form is submitted, the arrays - <computeroutput>$userfile</computeroutput>, - <computeroutput>$userfile_name</computeroutput>, and - <computeroutput>$userfile_size</computeroutput> will be formed in - the global scope (as well as in $HTTP_POST_FILES ($HTTP_POST_VARS - in PHP 3)). Each of these will be a numerically indexed array of - the appropriate values for the submitted files. - </simpara> - <simpara> - For instance, assume that the filenames - <filename>/home/test/review.html</filename> and - <filename>/home/test/xwp.out</filename> are submitted. In this - case, <computeroutput>$userfile_name[0]</computeroutput> would - contain the value <computeroutput>review.html</computeroutput>, - and <computeroutput>$userfile_name[1]</computeroutput> would - contain the value - <computeroutput>xwp.out</computeroutput>. Similarly, - <computeroutput>$userfile_size[0]</computeroutput> would contain - <filename>review.html</filename>'s filesize, and so forth. + ì를 ë¤ì´, ìì ììì <filename>/home/test/review.html</filename>ì + <filename>/home/test/xwp.out</filename> ì ë ê°ì íì¼ì ì ì¡íë¤ë©´ + <computeroutput>$userfile_name[0]</computeroutput> ìë + <computeroutput>review.html</computeroutput>ì´ë¼ë ê°ì´, + <computeroutput>$userfile_name[1]</computeroutput>ìë + <computeroutput>xwp.out</computeroutput>ì´ë¼ë ê°ì´ ì ì¥ëê² ëë¤. + ëìì, <computeroutput>$userfile_size[0]</computeroutput> ìë + <filename>review.html</filename>ì íì¼ í¬ê¸°ê° ì ì¥ëë ìì´ ëë¤ </simpara> <simpara> <computeroutput>$userfile['name'][0]</computeroutput>, @@ -285,9 +260,8 @@ <sect1 id="features.file-upload.put-method"> <title>PUT method support</title> <para> - PHP provides support for the HTTP PUT method used by clients such - as Netscape Composer and W3C Amaya. PUT requests are much simpler - than a file upload and they look something like this: + PHPë Netscape Composerë W3C Amayaê°ì í´ë¼ì´ì¸í¸ì ëí´ HTTP PUT ë°©ì(method)ì ì§ìíë¤. + PUT ì구(request)ë file uploadë³´ë¤ í¨ì¬ ì½ë¤. ë¨ì§ ë¤ìê³¼ ê°ì´ íë©´ ëë¤. : <informalexample> <programlisting> PUT /path/filename.html HTTP/1.1 @@ -295,16 +269,15 @@ </informalexample> </para> <para> - This would normally mean that the remote client would like to save - the content that follows as: /path/filename.html in your web tree. - It is obviously not a good idea for Apache or PHP to automatically - let everybody overwrite any files in your web tree. So, to handle - such a request you have to first tell your web server that you - want a certain PHP script to handle the request. In Apache you do - this with the <emphasis>Script</emphasis> directive. It can be - placed almost anywhere in your Apache configuration file. A - common place is inside a <Directory> block or perhaps inside - a <Virtualhost> block. A line like this would do the trick: + ì´ê²ì ë³´íµ ì격 í´ë¼ì´ì¸í¸ê° ë³´ë¸ ë´ì©ì ì¹ í¸ë¦¬ ë°ì /path/filename.htmlë¡ ì ì¥íë¼ë ì미ì´ë¤. + ê·¸ë°ë° ì¬ë¬ë¶ì ì¹ í¸ë¦¬ë°ì ìë íì¼ë¤ì ì무ë ë®ì´ ì¸ ì ìë¤ë ê²ì + Apacheë PHPì ìì´ì ì¢ì§ ìì ìê°ì´ë¤. + ë°ë¼ì ì´ì ê°ì ì구를 ë¤ë£¨ê¸° ì ì, ì°ì ì¹ ìë²ìê² ì´ë° ì구를 ë¤ë£¨ë + PHP ì¤í¬ë¦½í¸ë¥¼ 미리 ì§ì í´ ì£¼ì´ì¼ íë¤. + ìíì¹ììë <emphasis>Script</emphasis> ì§ììë¡ ê·¸ ë´ì©ì ì§ì íë¤. + ì´ ì§ììë Apache ì¤ì íì¼ì¤ì ì´ë ìì¹ì ìì´ë ê´ì°®ì¼ë, + ë³´íµ <Directory> ë¸ë¡ ìì´ë <Virtualhost> ë¸ë¡ ìì ìì¹íë ê²ì´ ì¼ë°ì ì´ë¤. + ë³´íµ ë¤ìê³¼ ê°ì´ ì¤ì íë¤. : <informalexample> <programlisting> Script PUT /put.php3 @@ -312,13 +285,12 @@ </informalexample> </para> <simpara> - This tells Apache to send all PUT requests for URIs that match the - context in which you put this line to the put.php3 script. This - assumes, of course, that you have PHP enabled for the .php3 - extension and PHP is active. + ì´ê²ì ì´ ë¼ì¸ì´ ìíë ë¸ë¡ì URIì í´ë¹ëë 모ë PUT ì구를 + put.php3 ì¤í¬ë¦½í¸ìê² ì ë¬íë¼ê³ Apacheìê² ìë ¤ ì¤ë¤. + ë¬¼ë¡ ì´ ê²½ì° .php3 íì¥ìì ëíì¬ PHPì¤ì ì´ ìë£ëì´ ìê³ , PHPê° ìëì¤ì´ì´ì¼ íë¤. </simpara> <simpara> - Inside your put.php3 file you would then do something like this: + put.php3 íì¼ì ë³´íµ ë¤ìê³¼ ê°ì´ 구ì±ë ì ìë¤. : </simpara> <para> <informalexample> @@ -328,20 +300,16 @@ </informalexample> </para> <simpara> - This would copy the file to the location requested by the remote - client. You would probably want to perform some checks and/or - authenticate the user before performing this file copy. The only - trick here is that when PHP sees a PUT-method request it stores - the uploaded file in a temporary file just like those handled but - the <link linkend="features.file-upload.post-method">POST-method</link>. - When the request ends, this temporary file is deleted. So, your - PUT handling PHP script has to copy that file somewhere. The - filename of this temporary file is in the $PHP_PUT_FILENAME - variable, and you can see the suggested destination filename in - the $REQUEST_URI (may vary on non-Apache web servers). This - destination filename is the one that the remote client specified. - You do not have to listen to this client. You could, for example, - copy all uploaded files to a special uploads directory. + ìì ëª ë ¹ì í´ë¹ íì¼ì ì격 í´ë¼ì´ì¸í¸ê° ìì²í ìì¹ì ë³µì¬íë ê²ì´ë¤. + ìë§ ì¬ë¬ë¶ì ë³µì¬í기 ì ì ì¬ì©ì를 íì¸íê±°ë íì¼ì ê²ì¬íë ë±ì 기ë¥ì ìí ê²ì´ë¤. + ì¬ê¸°ì ì ì ìë ê²ì PHPê° <link linkend="features.file-upload.post-method">POST-method</link>ì ì구를 ë°ìì ë + POST-method기ë¥ê³¼ ë§ì°¬ê°ì§ë¡ ìì íì¼ì í´ë¹ ë´ì©ì ì ì¥íë¤ë ê²ì´ë¤. + ì¦, ìêµ¬ê° ëëê² ëë©´ ììíì¼ì ì§ìì§ë¤. + ë°ë¼ì PUTì ë¤ë£¨ë PHP ì¤í¬ë¦½í¸ë í´ë¹ íì¼ì ì´ë ë¤ë¥¸ ê³³ì ë³µì¬í´ ëì´ì¼ íë¤. + ììíì¼ì ì´ë¦ì $PHP_PUT_FILENAME ì´ë¼ë ë³ìì ì ì¥ëê³ , + $REQUEST_URI ë³ìì í´ë¼ì´ì¸í¸ìì ë³´ë´ì¨ ì ì¥í íì¼ì ê²½ë¡ì ì´ë¦ì´ ì ì¥ëë¤. + (Apacheê° ìë ì¹ìë²ììë 모ìì´ ì¡°ê¸ ë¬ë¼ì§ë¤.) + ë¬¼ë¡ ì¬ë¬ë¶ì ì´ ê²½ë¡ëª ê³¼ íì¼ëª ì´ ìë ì í ë¤ë¥¸ ìì¹ì ë¤ë¥¸ íì¼ëª ì ì¬ì©í ìë ìë¤. </simpara> </sect1> </chapter>