search

Home  >  Q&A  >  body text

php - Qiniu JavaScript SDK restricts the type of uploaded files. Only PNG format images can be uploaded in the WeChat browser.

I set a restriction on the file type when uploading images using Qiniu JavaScript SDK
filters:{
mime_types:[

 {title : "Image files", extensions : "jpeg,gif,png,jpg,bmp"}

],
prevent_duplicates: false,
//max_file_size: imgMaxSize, //Maximum file size limit
max_file_size:imgMaxSize
},
WeChat browsing on mobile web PC side IOS All browsers can upload pictures in these formats
But now when opening the WeChat browser on Android, only PNG format pictures can be uploaded. Other pictures have been selected and there is no response
And JS SDK The init did not go in at all
But after canceling the mime_types parameter setting, all files can be uploaded
And this phenomenon only appeared at the end of 2016!

过去多啦不再A梦过去多啦不再A梦2811 days ago618

reply all(2)I'll reply

  • PHPz

    PHPz2017-05-16 13:14:05

    Never use any front-end SDK

    Input type="file" and html5 formdata+xmlhttprequest will do the trick. Simple and highly controllable

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:14:05

    I used Alibaba’s image uploading service and encountered the same situation as you. There was no response after selecting a jpg image. I thought it was because the Android version did not support jpg image uploading

    reply
    0
  • Cancelreply