Uppy: Renamed value is not sent via $_FILES[]

Created on 23 Feb 2018  路  2Comments  路  Source: transloadit/uppy

When renaming a file in uppy's dashboard and uploading it with XHRUpload through php, $_FILES['file']['name'] contains the original file name.

XHR Upload

Most helpful comment

Hmm yeah, that's confusing. Uppy's dashboard changes the file's metadata key name, so when using XHRUpload without the bundle option it'll be in $_POST['name']. The $_FILES array is populated from the File objects we send it, which have an immutable .name, so I don't know if we can change the filename in the $_FILES array; would be interesting to check out!

All 2 comments

Hmm yeah, that's confusing. Uppy's dashboard changes the file's metadata key name, so when using XHRUpload without the bundle option it'll be in $_POST['name']. The $_FILES array is populated from the File objects we send it, which have an immutable .name, so I don't know if we can change the filename in the $_FILES array; would be interesting to check out!

Added a note about this in https://github.com/transloadit/uppy/commit/14f8653a40d6f61ff7cba08971bb54d8d381b2c4, I don't think we can change the $_FILES[][name] value unfortunately. I hope that's clear enough!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

quetzyg picture quetzyg  路  3Comments

mokutsu-coursera picture mokutsu-coursera  路  3Comments

aleccool213 picture aleccool213  路  3Comments

oyeanuj picture oyeanuj  路  3Comments

evanoberholster picture evanoberholster  路  3Comments