Java Analog Touch screen version of QQ space upload pictures

Source: Internet
Author: User
Tags base64

Analog touch screen version of QQ space upload picture problem.



The first step: upload pictures.

Http://up.qzone.com/cgi-bin/upload/cgi_upload_pic_v2

Parameters:

Picture: "Image of Base64 Encoding" base64:1hd_height:480 "picture height" hd_width:320 "picture width" hd_quality:96 "picture quality, as if only 70&96, the number is high quality" Output_type:jsonpreupload:1charset:utf-8output_charset:utf-8logintype:sidexif_cameramaker: "Photo Exif" Exif_ Cameramodel: "Photo exif" Exif_time: "Photo exif" uin:17xxxx19 "QQ number" SID:AXXXXXXXXXXXXXXCWN "Sid"

Header information:

Accept:*/*accept-encoding:gzip, Deflateaccept-language:zh-cn,zh;q=0.8connection:keep-alivecontent-length : 53497content-type:application/x-www-form-urlencodedhost:up.qzone.comorigin:http://m.qzone.comreferer:http:// m.qzone.com/infocenter?g_f=2425user-agent:mozilla/5.0 (IPhone; U CPU iPhone os 6_0_1 like Mac os X; En-US) applewebkit/533.17.9 (khtml, like Gecko) version/5.0.2 mobile/8c148 safari/6533.18.5



return Result:
{"FileLen": 20319, "filemd5": "C8C4211055A01684B2A0BC112A674170B9C6BF323D129C4C923AA869D566E25C"}



Image Base64 Encoding processing method:
public static string Getimagestr (String imgfilepath) {//   byte[] data = null;    Reads a picture byte array  try {  InputStream in = new FileInputStream (imgfilepath);  data = new byte[in.available ()];  In.read (data);  In.close ();  } catch (IOException e) {  e.printstacktrace ();  }  The byte array Base64 encoded  base64encoder encoder = new Base64encoder ();  return Encoder.encode (data);//returns BASE64 encoded byte array string  


Step Two:
HTTP://UP.QZONE.COM/CGI-BIN/UPLOAD/CGI_UPLOAD_PIC_V2


Parameters:
OUTPUT_TYPE=JSONPREUPLOAD=2MD5=C8C4211055A01684B2A0BC112A674170B9C6BF323D129C4C923AA869D566E25C " The first step returns the Filemd5 "filelen=20319" in the result. The first step returns the FileLen "batchid=1425463906390000" New Date () in the result. GetTime () + "000" "currnum= 0uploadnum=1uploadtime=1425463906 "(New Date (). GetTime () +" "). Substring (0, 10)" Uploadtype=1upload_hd=1albumtype= 7big_style=1op_src=15001charset=utf-8output_charset=utf-8uin=1xxxx19 "QQ number" SID=AVXXXXXXXXXXXXXXCWN "Sid" Logintype =sidmobile_dc=actiontype%3d2%26subactiontype%3d1%26reserves%3d1%26page_type%3d2%26app_id%3d7003albumid=v1xxx6 " Photo Album ID "desc= test test" picture description "platformid=52platformsubid=11




But the results are returned:
{"Picinfo": {"error":-400}}



The discovery is a picture Base64 encoding processing Section error. Don't know how to do it.



Processing Picture BASE64 Encoding:


Http://qzonestyle.gtimg.cn/qzone/phone/m/v4/widget/photopicker/file2/index.js


Http://qzonestyle.gtimg.cn/qzone/phone/m/v4/widget/jpegEncode2.js




Java Analog Touch screen version of QQ space upload pictures

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.