saburab / angular-schema-form-nwp-file-upload Goto Github PK
View Code? Open in Web Editor NEWAngular Schema Form File Upload by Netzwerkplan
License: MIT License
Angular Schema Form File Upload by Netzwerkplan
License: MIT License
Hi, quick question. My request payload upon upload looks like this
------WebKitFormBoundary2peGSPa8RhMksnDX
Content-Disposition: form-data; name="file"; filename="conan1.gif"
Content-Type: image/gif
Is there any way to change ghat name="file"
to name="asset"
, for instance?
Thanks!
You use in your HTML-Template type="file". This isn't a valid attribut value.
https://www.w3.org/wiki/HTML/Elements/button#HTML_Attributes
To make this good, you should use type="button" for all buttons. This will make your html valid and prevent issues with implicit submit.
how to allow excel and csv file format for upload and also amazon s3 storage
There are two $templateCache pointing to the same template path in the distribution files. I think this has happened because the source file already has a $templatecache in it. My assumption is that the template should only be injected when you the run gulp build tasks. The templateCache in the source file also does not have any reference to the form.i18n object and it looks like this is the template which was used earlier.
Also, will it be possible to use the form.i18n labels only if it exists else fallback to the modules labels or have default labels preferably in english?
Example: We already had translation defined. However, since, with the latest update, they are no longer used in the template we have been getting elements without labels only to realize later that these labels are being defined as a part of the form object.
$translateProvider.translations('en', { 'modules.upload.dndNotSupported': 'Drag n drop not surpported by your browser', 'modules.attribute.fields.required.caption': 'Required', 'modules.upload.descriptionMultifile': 'Drop your file(s) here', 'modules.upload.descriptionSinglefile': 'Drop your file here', 'buttons.add': 'Open file browser', 'modules.upload.field.filename': 'Filename', 'modules.upload.field.preview': 'Preview', 'modules.upload.multiFileUpload': 'Multifile upload', 'modules.upload.field.progress': 'Progress', 'buttons.upload': 'Upload' });
Further, form.i18n is used only for the singleFileUpload template and not in the multifileUpload template.
Also, please add release versions so that we can target specific versions which worked for us.
Hello,
I succeeded in using your modules and it works perfectly. However I would like to use it in a form and the problem is that the user has to upload each file and then submit the form. Is it possible to launch the uploads with the form submission?
Thanks.
You can't properly get the error for picFile because ng-file-upload removes the failed validations from the model before its returned to your scope.selectFile or scope.selectFiles functions. ng-messages detects an issue and will display the proper element for the proper validation error, but the messages details are empty because picFile is undefined or otherwise empty.
angular-schema-form-nwp-file-upload/src/schema-form-file.js
Lines 120 to 122 in 9e0e277
In case you do not want the translate filter of the module 'pascalprecht.translate' then just remove '| translate' throughout the project.
i can upload the file and I could see the json response, But i could not see any updates on model of schemaform .. Any idea ?
angular-translate doesn't exist as a package. and you're specifying pascalprecht.translate as a dependency. Can you elaborate on this in your instructions please?
when i debug code after click on select file variable file coming as undefined.
scope.selectFile = function (file) {
scope.picFile = file;
scope.$parent.model[Object.keys(scope.form.key)[0]] = file;
scope.uploadForm.file.$setDirty(true);
};
Can you put instruction to use this?
$scope.schema = {
type: "object",
properties: {
first_name: {
type: "string", title: "First Name *", "default": "test name"
}
}
}
here we can assign a default value to a text box with first_name as ng-model
can anyone know how to assign default values to file upload schema ??
Hi,
I have installed your add-on successfully and was able to use your demo and upload image files. The only problem is that even if the required 'images' field has a file, it is flagged as error (red caption and help text). I was wondering whether I was missing a step or setup. I am using the latest version of schema-form library.
Regards.
I tried the drop file at http://codepen.io/sufius/pen/MaNQrY
and http://plnkr.co/edit/sboEMnUj5mzoyS2wqy4F?p=preview
but I don't see much action yet.
Also the 'open file browser' did not show an error when I selected a .PDF file. (just testing the error handling)
Can you confirm with which browser it works for you?
I tried with Chrome on Win10 and also Chrome on Ubuntu
Hi, there are some options in original library that allow you to trigger your own upload function but it seems that this library only provides an endpoint url. This doesn't give me any control over what is sent to the server. Is this functionality included but not documented?
I successfully integrated the add-on, but I have display problems (e.g., the add-files button has the following label "button.add") . Probably must I configure my controller in same way?
Thanks in advance.
LC
Module 'ngSchemaFormFile' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
Also are you consider versioning.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.