Coder Social home page Coder Social logo

Comments (2)

bkstar123 avatar bkstar123 commented on June 16, 2024

Hi @hoanguel

Thank you very much for using my package. I am really sorry to hear that you are facing an issue when implementing it in your project.

The package actually intends to process a single file uploading but not multiple files uploading at the backend server. It seems awkward at first, but the plan is to use it with an Ajax file uploading client such as the "fileinput" JQuery plugin. The JS client can be configured for multiple file uploading, in that case the JS client will send multiple files to the backend server via separate AJAX post requests. Then, the server process them one by one in an asynchronous way. The client side just see that multiple files can be selected and sent to the server at once.

So do not use name="template_files[]", just use name="template_files" & configure "fileinput" JQuery plugin to allow select multiple files & send them to the backend server in a batch. I can do multiple files uploading in this way for my projects.

Note:
Do not forget to add the attribute multiple="true"" to the HTML file input tag, for example:

<input class="form-control" type="file" name="template_files" id="template_files" multiple>

In my opinion, it is not good to select multiple files and send all via a single request to the server (the size of POST data may be too large, right?). We should send multiple files to the backend server on different requests (one request for one file) in an asynchronous way .

Also, I wrote a simple AJAX file upload client in https://github.com/bkstar123/jquery-ajax-uploader, you can use it.

If you need any other help or have any concern, feel free to let me know

Thank you again for your feedback

from laravel-uploader.

bkstar123 avatar bkstar123 commented on June 16, 2024

I closed the issue as it is working as design. You just need to enable sending multiple files from the client side via AJAX, then you will be able to upload multiple files to the server.

In your situation, you need to use the following HTML input tag

<input class="form-control" type="file" name="template_files" id="template_files" multiple>

The JS code is OK, no need to change.

If you still face any issue, feel free to re-open the issue

from laravel-uploader.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.