kartik-v / bootstrap-fileinput

An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
http://plugins.krajee.com/file-input
Other
5.35k stars 2.4k forks source link

please provide an example of server side processing #133

Closed SteveDCronin closed 9 years ago

SteveDCronin commented 9 years ago

your examples of dataurls are unhelpful.... Consider showing php code which handle $_Files and how that php is invoked in dataurl... I cannot get the file input to obey these inputs: $("#fileUploadButton").fileinput({ 'allowedFileExtensions': ["txt", "rtf", "rtfd", "text", "pdf", "csv", "doc", "docx", "xls", "xlsx"], 'mainClass': "input-group-sm", 'maxFileCount': 1, 'maxFileSize': 300 });

What am I doing wrong here? Does the file picker filter by type when it does work? I can select any type of file presented and no errors seem to occur? I want to suppress the file icon in the caption area to make more room for the file name. How do I do that? Is the php code responsible for the actual data handling to move the files to the server? You have spent a lot of time of getting a very powerful tool built but your documentation does not really help me. I have simplest possible case: 1 file, only text, no preview - just get the file uploaded and I cannot figure how to make this work!!!

kartik-v commented 9 years ago

How would you have implemented if it were a simple HTML file input that you are submitting via form and you need to write your PHP code? Start with a simple option like that without ANY additional plugin options. Then slowly build upon it with other options and validations and ajax URL etc. You may be trying too many things together without understanding the impact which may not be good if you are new at using the plugin. Would suggest you to read the plugin options and also the methods, and events.

I unfortunately do not have time for specific coding issues for each individual developer. But with regards to server code though, I have an extension of this plugin built for Yii PHP framework. You can also refer a few webtips that I do post when I get time and probably a few webtips are related to fileinput. You can refer them by clicking the bell icon on the top of the page adjacent to the page title for the plugin title (e.g. Bootstrap File Input).

kartik-v commented 9 years ago

I have created a webtip for server side processing example using PHP for folks who may need it.

SteveDCronin commented 9 years ago

YEAH! That, my good man, is excellent stuff — thank-you!

Steve

On Jan 18, 2015, at 11:45 PM, Kartik Visweswaran notifications@github.com wrote:

I have created a webtip for server side processing example using PHP http://webtips.krajee.com/ajax-based-file-uploads-using-fileinput-plugin/ for folks who may need it.

— Reply to this email directly or view it on GitHub https://github.com/kartik-v/bootstrap-fileinput/issues/133#issuecomment-70448763.