Php + bootstrapfileinput: An error occurred while uploading images. for help!

Source: Internet
Author: User
{Code ...} an error occurred. it seems to be a syntax error. I suspect there is an error in the fileinput event at the front end. because I only return one value for testing in the background, it should be okay. I am not familiar with fileinput, help !!! Who can give me an example? thank you!
Bug: SyntaxError: JSON. parse: unexpected character at line 1 column 1 of the JSON data. $ ("# file-5 "). fileinput ({language: 'zh ', // Setting language uploadUrl: "{: U ('Profile/upload ')}", // avatar_uploadyou must set a valid URL here else you will get an error _ UPLOAD _ partner/img allowedFileExtensions: ['jpg ', 'PNG', 'GIF'], overwriteInitial: false, maxFileSize: 1000, maxFilesNum: 1, // allowedFileTypes: ['image', 'video', 'flash'], slugCallback: function (filename) {alert ("aaa"); return filename. replace ('(','_'). replace (']', '_') ;}}). on ("fileuploaded", function (e, data) {var res = data. response; if (res. state> 0) {alert ('upload successful '); alert (res. path);} else {alert ('upload failed')}); background program I have public function upload () {} method, which is php's

An error occurred. it seems to be a syntax error. I suspect there is an error in the fileinput event at the front end. because I only return one value for testing in the background, it should be okay. I am not familiar with fileinput, help !!! Who can give me an example? thank you!

Reply content:
Bug: SyntaxError: JSON. parse: unexpected character at line 1 column 1 of the JSON data. $ ("# file-5 "). fileinput ({language: 'zh ', // Setting language uploadUrl: "{: U ('Profile/upload ')}", // avatar_uploadyou must set a valid URL here else you will get an error _ UPLOAD _ partner/img allowedFileExtensions: ['jpg ', 'PNG', 'GIF'], overwriteInitial: false, maxFileSize: 1000, maxFilesNum: 1, // allowedFileTypes: ['image', 'video', 'flash'], slugCallback: function (filename) {alert ("aaa"); return filename. replace ('(','_'). replace (']', '_') ;}}). on ("fileuploaded", function (e, data) {var res = data. response; if (res. state> 0) {alert ('upload successful '); alert (res. path);} else {alert ('upload failed')}); background program I have public function upload () {} method, which is php's

An error occurred. it seems to be a syntax error. I suspect there is an error in the fileinput event at the front end. because I only return one value for testing in the background, it should be okay. I am not familiar with fileinput, help !!! Who can give me an example? thank you!

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.