Code Monkey home page Code Monkey logo

Comments (4)

yanzhenjie avatar yanzhenjie commented on August 24, 2024

首先要確定下你的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.

a3858293 avatar a3858293 commented on August 24, 2024

開發者大大您好,我使用的版本是 1.0.4 ,因為我 php 代碼也是參考其他大大寫的,如果要讓php代碼不被覆蓋,需要設定什麼參數嗎?

from nohttp.

a3858293 avatar a3858293 commented on August 24, 2024

File file1 = new File(Environment.getExternalStorageDirectory().getPath()+"/xxx.txt");
File file2 = new File(Environment.getExternalStorageDirectory().getPath()+"/yyy.txt");

開發者大大您好,我上傳的檔名是不一樣的,這樣我php也會被覆蓋過去嗎?

from nohttp.

yanzhenjie avatar yanzhenjie commented on August 24, 2024

你看看我上面回答的,我剛才完善過了。如果你成功解決了,請在這裡回覆一下。服務端的php要保證不能覆蓋文件,這個你可以搜索一下其他人寫的。

from nohttp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.