I don't think i am following all your instruction because it is still not working!!! Attachments godsbest. Re: Re: Does any one know how to use "Ajax Upload; A file upload script with progress-bar, drag-and-drop. When you say 'still not working' what do you mean? Can you elaborate? Here is a minimal setup I just put up using your files. The only file I changed yours had no content is index.
This setup works; doesn't it? Please note that my server is setup not to accept uploads; therefore you won't be able to make any actual uploads. However you do get a response from the qqFileUploader class of php.
How come your index. Is that why it is not working? Okay So the index. When I said it is not working. Everytime I select files to upload the results is fail! So I see a list of the file names and the size but it always says failed! So it does not upload the files to the server!
I need to move the files on the server then put all the files in a variable to store the file names into my database! You can use Firebug in Firefox or the debug tool for your browser to look at the response from the server; it should give you an idea why the upload failed.
Is your page live yet? For instance, for my environment, this is the response I get which also shows in a popup window :. Hello I don't know how to use the firebug! Thanks for your time. So I think I got it to work finally!!! How can i do that? Thanks d. For that you can use the onComplete option to capture the file names and to store to database:. I want to store the file names along with the rest of the input values using PHP.
But how can i places those file names in the hidden input upon passing the upload??? If your markup is as shown below then you can use the code show to store a comma-separated list of file names:. But i do have one more thing since we are separating the file names with a comma I do need to replace the uploaded file names! Hi again will this also replace the actual uploaded file, because it seems to me that this only update the string but not the actual file that is on the server!!
That you have already taken care of in PHP, haven't you? Warning: if the PHP change does not actually re-name the file you may have issues when retrieving the files down the line. The JS change above ensures that the file names saved to database have been adjusted using your renaming rules so you don't have a mismatch. It is not possible to rename the files uploaded using JS. Oh, I did took care of it in the PHP class but it is not changing the file name so I thought there is something in the javascript file that needs to be changes in order for it to be uploaded!!!
Now create a blade view file progress-bar-file-upload. Then put the following code into progress-bar-file-upload. Now we are ready to run our example so lets start the development server using following artisan command —.
Schema :: dropIfExists 'docs' ;. Route :: get 'ajax-file-upload-progress-bar' , [ UploadFileController :: class , 'index' ] ;. Route :: post 'store' , [ UploadFileController :: class , 'store' ] ;.
When you open the html file in the browser you will get a file upload form with upload button like this. The uploadFile API creates ajax form and uploads the files to server. This method takes up various options as parameters to customize its behavior. Next we have to create the php file 'upload. Once the file uploading ajax form is submitted, this php script will be executed where the actual file uploading process takes place.
Read this article to learn how file upload process works in php. All the selected files will be uploaded to the 'uploads' directory. And progress bars will be shown at the bottom of the forms for each file along with an 'Abort' button. Once the uploading process is completed it shows 'Done' button at the end of the progress bar. This is a very user friendly feature available in this plug-in. If you don't want the abort and done buttons to show in the progress bar, then set them to false like this,.
That was all about drag and drop multiple file uploading process using jquery, ajax and php.
0コメント