thinkphp do, deploy on IIS, upload a picture "Upload directory not writable"

Source: Internet
Author: User
Public function upload () {//import Picture upload class import ("ORG.Net.UploadFile");        Instantiate the Upload class $upload = new UploadFile ();        $upload->maxsize = 3145728;        Set file upload type $upload->allowexts = array (' jpg ', ' gif ', ' PNG ', ' jpeg '); Set File upload location $upload->savepath = __root__. '        /public/uploads/images/';        Set the file upload name (by time) $upload->saverule = "Times";        if (! $upload->upload ()) {$this->error ($upload->geterrormsg ());        }else{//Upload successful, get upload information $info = $upload->getuploadfileinfo ();        } $savename = $info [0][' Savename '];        $url = $savename;        Save the form data, including the uploaded picture $model = M ("Pkxs");        if (false = = = $model->create ()) {$this->error ($model->geterror ());        }//Update data $list = $model->save ();            if (false!== $list) {//successful prompt $this->assign (' Jumpurl ', Cookie::get (' _currenturl_ ')); $this->success (' Editorial success! ');        } else {//error prompt $this->error (' Edit failed! '); }    }

The directory in the code is there, I also have the entire "uploads" folder and subfolders in IIS "write" permission, why or Prompt "upload directory/web/wpm/public/uploads/images/not writable"?


Reply to discussion (solution)

Is your upload directory on the website?
If yes, you need to check "write" in IIS Admin

From the root to your upload directory, the path name cannot have Chinese
The default character set for Windows is GBK, and TP is Utf-8

It is not sufficient to have write access to a folder that is not managed by IIS, and you need to check the Allow archive in the Advanced tab

Is your upload directory on the website?
If yes, you need to check "write" in IIS Admin

From the root to your upload directory, the path name cannot have Chinese
The default character set for Windows is GBK, and TP is Utf-8

It is not sufficient to have write access to a folder that is not managed by IIS, and you need to check the Allow archive in the Advanced tab

I would like to ask the moderator, I want to check my entire project directory "write"? Or do you just tick "write" The upload directory?

There is no Chinese path.

IIS is configured for the entire Web site.

I found the reason, not the IIS configuration issue, is that the write permission of the users who uploaded the directory folder is not given.

Or to thank the moderator! Knot stickers to points!

  • 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.