If the file name contains Turkish characters (ş, ı, ü, ü, ö, ğ), the file is not uploaded to the web server. The upload to web server is done on php page. There is no problem there. It uploads file names that do not contain Turkish characters (English letters). How do I solve this problem?
private String uploadFile()
{
String responseString = null;
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(Config.FILE_UPLOAD_URL);
try
{
AndroidMultiPartEntity entity = new AndroidMultiPartEntity(new ProgressListener() {
@Override
public void transferred(long num) {
publishProgress((int) ((num / (float) totalSize) * 100));
} });
File kaynakDosya = new File(filePath);
entity.addPart("dosya", new FileBody(kaynakDosya));
entity.addPart("islem", new StringBody(GlobalVeri.IslemFotoVideoDosya));
totalSize = entity.getContentLength();
httppost.setEntity(entity);
HttpResponse response = httpclient.execute(httppost);
HttpEntity r_entity = response.getEntity();
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == 200) {
responseString = EntityUtils.toString(r_entity);
} else {
responseString = "Bir hata oluştu! Http Durum Kodu: " + statusCode;
}
}
catch (ClientProtocolException e) {
responseString = e.toString();
}
catch (IOException e) {
responseString = e.toString();
}
return responseString;
}