1
我有下面的代码工作:当我使用Android上传文件时,如何重命名文件?
MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
entity.addPart("userfile", new FileBody(f));
httppost.setEntity(entity);
HttpResponse response = httpclient.execute(httppost);
的问题是,File f
的名称是“ABC-temp.jpg”,我希望它是“xyz.jpg”当我把它上传。我不想重命名设备上的文件,但只有上传。
要做到这一点,最好的方法是什么?
,如果你把它上传在服务器上怎么样进行重命名服务器上通过使用Web serivecs –
http://stackoverflow.com/questions/2896733/how-to-rename-a-file-on-sdcard-with -android-application –
@mohammed momn - 在这一点上,让我们假设我无法做到这一点。 –