gpt4 book ai didi

android - 如何将多张图片上传到图片服务器

转载 作者:行者123 更新时间:2023-11-29 21:14:49 29 4
gpt4 key购买 nike

将图像从 android 上传到服务器的最佳方式是什么?我需要将多张图片上传到特定的文件夹和路径,以便从服务器返回。

最佳答案

我强烈建议您在一次上传多个 文件/图像时使用 Square 的 Tape,以查看易用性、效率、错误处理和排队系统。如果您一次只使用一个文件,请尝试使用 multi-part file upload 中的任何一个在任何 android Http clients

这就是Square's Tape :

Tape is a collection of queue-related classes for Android and Java by Square, Inc.

QueueFile is a lightning-fast, transactional, file-based FIFO. Addition and removal from an instance is an O(1) operation and is atomic. Writes are synchronous; data will be written to disk before an operation returns. The underlying file is structured to survive process and even system crashes and if an I/O exception is thrown during a mutating change, the change is aborted.

An ObjectQueue represents an ordering of arbitrary objects which can be backed either by the filesystem (via QueueFile) or in memory only.

TaskQueue is a special object queue which holds Tasks, objects which have a notion of being executed. Instances are managed by an external executor which prepares and executes enqueued tasks.

关于android - 如何将多张图片上传到图片服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21721473/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com