Did you ever use Dropzonejs to drag and drop files? How PHP gets its value.

Source: Internet
Author: User
Tags file info
                     

Reply content:

                     

Paste part of the code you see, backstage is Nodejs, hope to help you
View

Api:

exports.upload = function(req, res) {    //express file info    var resource = req.files.resource;}

Js:


$("#fmUpload").dropzone({ paramName: 'resource',(看此处) url: '/images/upload', dictDefaultMessage: '将文件拖拽至此区域进行上传(或点击此区域)', acceptedFiles: 'image/*', parallelUploads: 1, maxFilesize: 1, maxFiles: 1, init: function() {}, success: function(file, data) { if (data.status === 1) { $scope.uploadImage = data.message; $scope.listUserImages(); } else { alertService.showAlert({ content: data.message, type: 'warning' }); $('.dz-error-mark').show(); } } });

Want to ask the landlord, your data.php, in addition to do file upload operation, other such as operation of the database operation can be carried out?
I am also using this plugin, but encountered a problem, when the selected file upload to the specified path, the foreground how to display, want to file upload operation, the database insert operation, but can not be executed, I do not know whether the landlord has encountered such a problem?

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