2012-06-12 30 views
0

我有以下幾點:如何使用CURL在Parse中上傳文件?

捲曲-X POST \ -H 「X-解析,應用ID:APPID」 -H 「X-解析-REST的API密鑰:restkey」 -H「內容類型:text/plain「 -d'Hello,World!' https://api.parse.com/1/files/hello.txt

我回來:

{ 「URL」:「http://files.parse.com/7680c0e7-b398-4b43-91f0-61b12934c690/08d828ef-1185-4036-b8ab-228764fbeb69 -hello.txt「,」name「:」08d828ef-1185-4036-b8ab-228764fbeb69-hello.txt「}

我應該使用什麼文件名?

回答

0

的URL回來了 - 你把一切後http://files.parse.com/

這涉及到以下幾點:

捲曲-X POST \ -H 「X-解析,應用ID:APPID」 \ -H 「X-Parse-REST-API-Key:reskey」\ -H「Content-Type:application/json」\ -d'{ 「name」:「blisdco」, 「picture」:{ 「name 「:」7680c0e7-b398-4b43-91f0-61b12934c690/08d828ef-1185-4036-b8ab-228764fbeb69-hello.txt「, 」__type 「: 」文件「 }} 」 \ https://api.parse.com/1/classes/CustomerImages

,什麼是返回是:

{ 」createdAt「: 」2012-06-12T20:16:05.360Z「, 」對象ID「:」 yHLhqMgBAj「}

如果您查看Parse Data Browser中的CustomerImages表,您會看到條目 - 包括URL的文件名部分。

相關問題