Comments (4)
首先要確定下你的NoHttp的版本,在NoHttp1.0.4之前多文件上傳,每個文件只能有一個獨立的key,否則會被覆蓋,我猜你的情況可能是request.add("file", XXXBinary)
被request.add("file", YYYBinary)覆蓋了。
如果服务器不支持一个key多个文件,而你不想被覆盖可以用多个key多个文件的方式:
request.add("xxxFile", XXXBinary);
request.add("yyyFile", YYYBinary);
其次NoHttp1.0.4開始支持一個Key上傳一個FileList,這樣的話支持這樣寫:
request.add("file", XXXBinary);
request.add("file", YYYBinary);
或者
List<Binary> binaries = new ArrayList<>();
binaries.add(XXXBinary);
binaries.add(YYYBinary);
binaries.add(ZZZBinary);
request.add("file", binaries);
最後,如果你使用的NoHttp版本是1.0.4或者更高,那麼可能是你PHP服務器的文件被覆蓋了。
歡迎繼續留言。
from nohttp.
開發者大大您好,我使用的版本是 1.0.4 ,因為我 php 代碼也是參考其他大大寫的,如果要讓php代碼不被覆蓋,需要設定什麼參數嗎?
from nohttp.
File file1 = new File(Environment.getExternalStorageDirectory().getPath()+"/xxx.txt");
File file2 = new File(Environment.getExternalStorageDirectory().getPath()+"/yyy.txt");
開發者大大您好,我上傳的檔名是不一樣的,這樣我php也會被覆蓋過去嗎?
from nohttp.
你看看我上面回答的,我剛才完善過了。如果你成功解決了,請在這裡回覆一下。服務端的php要保證不能覆蓋文件,這個你可以搜索一下其他人寫的。
from nohttp.
Related Issues (20)
- RequestQueue多并发实现问题
- 请求头部的添加,自动把键值的首字母改成大写 HOT 1
- 上传进度条问题new FileInputStream(file), "application/octet-stream" 如何设置上传进度条 HOT 1
- 上传请求的数据中包含list list里面是map数据,请问如何上传 HOT 5
- 你好问下表单提交file能拿到上传进度的回调吗
- 报错 v1.1.11 HOT 1
- 使用studio3.2版本在安卓9.0机型请求失败
- 多文件上传 bug HOT 1
- Ftp下载 HOT 1
- 不回调success,Debug发现报 java.util.concurrent.CancellationException
- 设置返回编码无效
- NoHttpSample: java.net.SocketException: socket failed: ENONET (Machine is not on the network)
- 支持https不
- 同步请求数据返回为 “”, 同样的url 异步请求没问题
- post请求中文乱码
- The network is not available, please check the network
- target 29 下载报权限异常 HOT 1
- NoHttpSample: okhttp3.internal.http2.StreamResetException: stream was reset: PROTOCOL_ERROR HOT 1
- 为什么下载后文件正常但是重启设备后文件的后缀多了.nohttp 导致文件异常
- 请求头部的添加,自动把键值的首字母改成大写 ,这个有方法避免吗
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nohttp.