美文网首页
backgroundSessionConfigurationWi

backgroundSessionConfigurationWi

作者: 今年27 | 来源:发表于2018-09-21 21:11 被阅读28次

https://stackoverflow.com/questions/41103104/upload-file-use-uploadtaskwithrequestfromfile-in-background-and-use-multipart

Okay, so this was kind of just me being foolish and not thorough here:

  1. I'd set an exception breakpoint to get stack traces that was preventing me from see the actual exception error printout -- oops.

  2. Can't use version of uploadTaskWithRequest that has a completion callback for a backgroundSessionConfiguration (not surprising but still not well documented).

  3. Write your PNG data to /var/... and provide it to uploadTaskWithRequest with file:///var/... (this is just awkward because you don't often need to convert between the two for a single sequence of commands)

Happy to put up a NSUrlSessionUploadTask sample code here, since there seems to be zero of them on the entire interwebs. LMK if anyone wants that.

相关文章

网友评论

      本文标题:backgroundSessionConfigurationWi

      本文链接:https://www.haomeiwen.com/subject/duwznftx.html