Exemplo n.º 1
0
func getHead() string {
	var str = `
----BD**VR++LIB
Content-Disposition: form-data; name="identity"

F651F8EAF45ACDDA4FE690ED0F142CBF|644879920063368
----BD**VR++LIB
Content-Disposition: form-data; name="idx"

-1
----BD**VR++LIB
Content-Disposition: form-data; name="product"

790
----BD**VR++LIB
Content-Disposition: form-data; name="global_key"

`
	str += uuid.Rand().Hex()

	str += `
----BD**VR++LIB
Content-Disposition: form-data; name="return_type"

json
----BD**VR++LIB
Content-Disposition: form-data; name="protocol"

1
----BD**VR++LIB
Content-Disposition: form-data; name="version"
1.3.0.0

----BD**VR++LIB
Content-Disposition: form-data; name="prop"

10004
----BD**VR++LIB
Content-Disposition: form-data; name="app_name"
com.baidu.searchbox

----BD**VR++LIB
Content-Disposition: form-data; name="platform"

Android&MI+4W&4.4.4&19
----BD**VR++LIB
Content-Disposition: form-data; name="encode"

utf-8
----BD**VR++LIB
Content-Disposition: form-data; name="content"; Content-Type: audio/x-wav

`
	str = strings.Replace(str, " ", "", -1)
	str = strings.Replace(str, "\n", "\r\n", -1)
	return str
}
Exemplo n.º 2
0
/****
* 获取上传后的配置信息
 */
func getRemotePath(localPath string) string {
	uid := uuid.Rand().Hex()
	uid = uid + localPath[strings.LastIndex(localPath, "."):]
	return uid
}