innostudio / fileuploader

Beautiful and powerful HTML file uploading tool. A jQuery, PHP and Node.js plugin that transforms the standard input into a revolutionary and fancy field on your page.
141 stars 25 forks source link

Avatar file route problem in Symfony 5 #55

Closed lukaszkulinski closed 4 years ago

lukaszkulinski commented 4 years ago

Hi, I can't generate thumbnail for uploaded avatar when route of page has more elements than one.

This is my data-fileuploader-files value: [{"file":"uploads/horse_profile_pictures/survey-5ef1bf5c254df.jpeg"}]

When the route is: localhost/avatar, then works fine

but when the route is: localhost/avatar/username, then script try to find file in:

localhost/avatar/uploads/horse_profile_pictures instead of localhost/uploads/horse_profile_pictures

innostudio commented 4 years ago

Hello, try to change the file attribute and put a public url and local attribute as information for backend. Here is an example:

[{
    name: 'survey-5ef1bf5c254df.jpeg',
    size: 1024,
    type: 'image/jpeg',
    file: 'http://localhost/avatar/uploads/horse_profile_pictures/survey-5ef1bf5c254df.jpeg',
    local: 'uploads/horse_profile_pictures/survey-5ef1bf5c254df.jpeg' // this attribute will go in the hidden input
}]