PHPMVC framework skymvc supports multifile Upload. _ PHP Tutorial

Source: Internet
Author: User
The PHPMVC framework skymvc supports multifile Upload ,. The PHPMVC framework skymvc supports multi-file upload. the example in this article shares the specific code of skymvc for file upload for your reference. the specific content is as follows: 1. code upload. ctrl. phpphp php mvc framework skymvc supports multifile Upload,

This article provides examples to share with you the specific code for Implementing File upload using skymvc for your reference. the specific content is as follows:

1. code upload. ctrl. php

<? Phpclass uploadControl extends skymvc {public function _ construct () {parent ::__ construct ();} public function onDefault () {$ this-> smarty-> display ("upload/default.html");} public function onUpload () {$ this-> loadClass ("upload "); // the uploaded file directory $ this-> upload-> uploaddir = "attach/my/"; // The file size that can be uploaded $ this-> upload-> maxsize = 4194304000; // whether to upload an image $ this-> upload-> upimg = true; // you can specify the file type that can be uploaded. $ this-> upload-> sysallowtyp E = array ('GIF', 'jpg ', 'bmp', 'PNG ', 'jpeg', 'txt ', 'MPEG', 'Av', 'rm ', 'rmvb ', 'wmv', 'flv', 'mp3', 'wav ', 'wm', 'swf', 'Doc', 'PDF ', 'Zip ', 'tar ', 'svg'); $ this-> upload-> allowtype = $ this-> upload-> sysallowtype; // store $ this-> upload-> iddir = 0 by Id; $ data = $ this-> upload-> uploadfile ("upimg "); // print_r ($ data); echo json_encode ($ data) ;}}?>

2.code upload.html

{Include file = "head.html "}{Include file = "header.html "}

Upload result

{Include file = "footer.html "}

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.