cartjs icon indicating copy to clipboard operation
cartjs copied to clipboard

Upload file

Open bakura10 opened this issue 9 years ago • 2 comments

Hi,

Did anyone had experience with uploading file properties using CartJS? When I set the properties into the addToCart method, it jsut sends the file name to the back-end instead of uploading it.

Thanks ^^.

bakura10 avatar May 24 '16 13:05 bakura10

As per https://cartjs.org/pages/guide#data-api-submitting-forms, there are browser limitations with uploading files via Ajax. These limitations are probably not as significant with modern browsers, so it may be possible to feature-detect and enable Ajax uploads conditionally based on browser support. Happy to look at PRs or to discuss further if there's an easy fix.

gavinballard avatar May 24 '16 14:05 gavinballard

what do you think about using formdata for file uploads?

https://www.mkyong.com/jquery/jquery-ajax-submit-a-multipart-form/

thanks for this wonderful library!

keyurshah avatar Apr 10 '17 15:04 keyurshah