The solution of uploading failure when uploading multiple files (Pictures) using Kindeditor/uploading with Flash upload multiple files (picture) upload failed

Source: Internet
Author: User

Recently the user reflects the hope that we put the online editor of the multi-image upload function, because they often have to edit the product description of the need to upload more than one picture, if you want to choose the efficiency is very low, the customer's demand is our pursuit, soon we put the perfect function into the schedule, the request to achieve as soon as possible.

The online editor we use in the project is kindeditor4.1.10 their multi-file upload plugin is using the flash realized, originally should be able to use, but why always show upload failure, Baidu has a bit of experience and lessons from the predecessors, there are two possible: 1 ) uploaded target folder does not have write permission, resulting in the uploaded file cannot write operation, so upload failed; Span style= "Font-family:times New Roman" >2 ) There are systems that do permission validation because of the use of flash When uploading, because on upload flash plugin did not put bring past, cause session missing causes upload to fail.

We are doing a single and multiple uploads of the target path is in the same parent folder, so it will not be the first case caused, it is only the second case, based on such a judgment, it will be in the Flash upload manually add SessionId parameters and values, to the service side of the time to receive the application to the Session , this should be able to solve the problem, it turns out that the idea is correct, the following specific methods of operation.

Open it/kindeditor/plugins/multiimage/multiimage.js, findPostparamsThis configuration item, the original configurationPostparams:k.undef (Self.extrafileuploadparams, {}),insteadpostparams: $.extend (K.undef (Self.extrafileuploadparams, {}), {"__jentianyunsessionid": Jt.cookie (' __ Jentianyunsessionid ')}),above the__jentianyunsessionidshould be replaced by yours.sessionIdof thenameproperty, so that you canFlashwhen uploading the file, put yourSessionIdTo the Server page, and then to the beginning of the page to process the uploaded file plus

$session =\tools\tools::allchar (' __jentianyunsessionid ');

if ($session) {// reset cookiesto solve The loss of cookies when uploading images using Flash

session_id ($session);

Session_Start ();

}

In this way, kindeditor/Flash implementation of multi-file (image) upload will be successful

The solution of uploading failure when uploading multiple files (Pictures) using Kindeditor/uploading with Flash upload multiple files (picture) upload failed

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.