Offer file upload for customer - Possible

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
aimeos
Administrator
Posts: 7896
Joined: 01 Jan 1970, 00:00

Re: Offer file upload for customer - Possible

Post by aimeos » 12 Dec 2020, 18:58

Uploaded files are not part of the $_POST variable but in $_FILES which you can access by $view->request()->getUploadedFiles()
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

bozo
Posts: 6
Joined: 08 Dec 2020, 07:13

Re: Offer file upload for customer - Possible

Post by bozo » 13 Dec 2020, 16:22

you are right, it should be in $_FILES.
Sadly empty.

I think the my main problem is related to "Content-Type"

Basket checkout is always "application/x-www-form-urlencoded; charset=UTF-8".
For file upload it is must be "multipart/form-data;", otherwise it won't work.
I tried to change it in all possible ways, but no luck. It is still sending x-www-form.

User avatar
aimeos
Administrator
Posts: 7896
Joined: 01 Jan 1970, 00:00

Re: Offer file upload for customer - Possible

Post by aimeos » 14 Dec 2020, 10:09

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

bozo
Posts: 6
Joined: 08 Dec 2020, 07:13

Re: Offer file upload for customer - Possible

Post by bozo » 14 Dec 2020, 19:27

yes, I did.

Days later in my despair all possible places where "application/x-www-form-urlencoded" found.

no luck.

nos3
Posts: 89
Joined: 01 Sep 2015, 13:26

Re: Offer file upload for customer - Possible

Post by nos3 » 15 Dec 2020, 18:14

Guess, the problem is the XHR request done instead of a normal POST by the browser:
https://github.com/aimeos/ai-client-htm ... s.js#L1284

This example code may help to implement a file upload using jQuery XHR:
https://makitweb.com/how-to-upload-imag ... ry/#jQuery

Post Reply