나는 다음과 같은 코드 작업이 있습니다파일을 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"를되고 싶어합니다. 그래도 장치의 파일 이름을 바꾸고 싶지는 않지만 만 업로드 할 수 있습니다.
이렇게하는 가장 좋은 방법은 무엇입니까?
당신은 웹 serivecs –
http://stackoverflow.com/questions/2896733/how-to-rename-a-file-on-sdcard-with 사용에 대한 것은 서버에서 이름을 바꿀 어떤 서버에 업로드하는 경우 -android-application –
@mohammed momn -이 시점에서 내가 할 수 없다고 가정합시다. –