Moony_Uploaderã¯ã©ã¹
Moony 0.8.0ããMoony_Uploaderã¯ã©ã¹ã追å ããäºå®ã§ãã使ç¨ä¾ã¯:
<form action="/index.php/upload" enctype="multipart/form-data" method="POST"> <input type="file" name="userfile" /> <input type="submit" value="send" /> </form>
ä¸è¨ã®ãããªãã©ã¼ã ãããå ´åã
class UploadAction extends Moony_Action { function execute($request, $response) { $uploader =& new Moony_Uploader('userfile'); $mime_type = $uploader->getMimeType(); // checks mime type... if ($uploader->upload('/path/to/save_dir', 0644)) { // success } else { // failure } } }
ä¸è¨ã®ããã«è¨è¿°ãããã¨ã§ãã¡ã¤ã«ã¢ãããã¼ãå¦çãè¡ããã¨ãã§ãã¾ãã