Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Android photo upload function - MIME

Android photo upload function - MIME

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

Android photo upload function - MIME

Postby cock0810 » Fri Oct 25, 2013 7:52 am

Hi,
I’m working on modifying a photo upload program but facing a problem. During packet grabbing, it will not show up “Media Type” and “Data” (Data should be separated to 3, not 1 only). I’ve tried to adjust program codes for many times but still could not get the expecting result. It would be appreciated if anyone who can point out where the problem is. Thank you!!

Code: Select all
/***
* The following parameters are used to upload.
*/
if (param != null && param.size() > 0) {
    Iterator<String> it = param.keySet().iterator();
        while (it.hasNext()) {
        sb = null;
        sb = new StringBuffer();
        String key = it.next();
        String value = param.get(key);
        sb.append(PREFIX).append(BOUNDARY).append(LINE_END);
        sb.append("Content-Disposition: form-data; name=\"").append(key).append("\"").append(        LINE_END).append(LINE_END);
        sb.append(value).append(LINE_END);
        params = sb.toString();
        Log.i(TAG, key+"="+params+"##");
        dos.write(params.getBytes());
    }
}
     
sb = null;
params = null;
sb = new StringBuffer();

sb.append(PREFIX).append(BOUNDARY).append(LINE_END);
sb.append("Content-Disposition: form-data; name=\"" + fileKey + "\"; filename=\"" + file.getName() + "\"" + LINE_END);
sb.append("Content-Type: application/octet-stream" + LINE_END+LINE_END);
sb.append(LINE_END);
     
params = sb.toString();
//sb = null;

sb.append(PREFIX).append(BOUNDARY).append(LINE_END);
sb.append("Content-Disposition: form-data; name=\"seq\""+ LINE_END+LINE_END);
sb.append(LINE_END);
params = sb.toString();
//sb = null;
//dos.write(params.getBytes());
     
sb.append(PREFIX).append(BOUNDARY).append(LINE_END);
sb.append("Content-Disposition: form-data; name=\"lang\""+ LINE_END+LINE_END);
sb.append(LINE_END);
params = sb.toString();
//sb = null;
//dos.write(params.getBytes());
     
sb.append(PREFIX).append(BOUNDARY).append(LINE_END);
sb.append("Content-Disposition: form-data; name=\"tId\""+ LINE_END+LINE_END);
sb.append(LINE_END);
params = sb.toString();
//sb = null;

Log.i(TAG, file.getName()+"=" + params+"##");
dos.write(params.getBytes());
cock0810
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Oct 25, 2013 7:24 am

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 3 guests