Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong file name in file type when uploading #856

Open
wadjeroudi opened this issue Dec 14, 2015 · 4 comments
Open

Wrong file name in file type when uploading #856

wadjeroudi opened this issue Dec 14, 2015 · 4 comments
Labels

Comments

@wadjeroudi
Copy link

Hey,

nga.field('image', 'file').uploadInformation({
            'url': imageUrl,
            'headers': {'Authorization': token},
            'apifilename': 'image'
        }),

In the request the name property has a wrong value :

Content-Disposition: form-data; name="file"; filename="toto.jpg"

It should be "image".
The html markup of the input has the correct value:

<input type="file" ngf-multiple="multiple" accept="*" ngf-select="fileSelected($files)" id="image" name="image" ng-required="v.required" style="display:none">

I can't find the problem, ng-admin seems to correctly pass the filename to ng-file-upload.

@fzaninotto
Copy link
Member

ping @jeromemacias any hint?

@hobywhan
Copy link

any update ?

@Kmaschta
Copy link
Contributor

Kmaschta commented Nov 18, 2016

Until we code a solution for the Image and Upload fields, here is a workaround: #541 (comment)

@challet
Copy link

challet commented Aug 21, 2017

From what I understand from the doc, apifilename is not for specifying the request but for how to handle the response.

filename assigned by the server and returned by your API

The html markup might be using the name you pass as 1st arg to nga.field('image', 'file'), not the one from apifilename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants