Hi Guys,
I think there may be an issue with the content download on Corona SDK.
Whenever I set ThruCDN to false, I can download files, but as soon as I set ThruCDN to true when downlaoding the file I get an error message on the console telling me "Invalid Parameter: URL argument was malformed URL"
Answer by Brendan · Jan 08, 2017 at 10:06 PM
The results should be the same as if you called GetContentDownloadUrl any other way. Can you try getting the download URL by making the call in Postman, and see if that URL works for you? If not, can you describe specifically how you're making the download call itself, and what the info is for the file (Title ID and Key for the file)?
This is how my code looks like. How can I do the call in Postman?
-- ACTUAL DOWNLOAD local function actualDownload( result ) local params = {} print(result.URL) network.download( result.URL, "GET", onComplete, params, pathEditorZip, system.DocumentsDirectory ) end -- GET DOWNLOAD URL local downloadRequest = { Key = pathCloud, HttpMethod = "GET", ThruCDN = true } PlayFabClientApi.GetContentDownloadUrl(downloadRequest, actualDownload, function(error) print(" Failed DOWNLOAD URL: " .. error.errorMessage) end )
Postman is a tool that lets you make Web API calls quickly and easily, to test out functionality: https://www.getpostman.com/.
We also provide a complete Postman Collection for all PlayFab API calls: https://github.com/PlayFab/PostmanCollection.
From your code, it actually appears that there isn't a problem with the PlayFab API call (which gets the URL for the download), but rather with the network.download call. Here's what I would recommend:
Get the download URL from our service, whether via your code or Postman, with ThruCDN set to true. Use that to try to download the file directly, using cURL (as described here: https://playfab.com/how-use-playfabs-content-management-api/). If that works, you know that the issue is with the network.download call itself, in which case you'll need to reach our to the Corona team. If that doesn't work, please open a ticket and send us all the details of your test - the specifics of the GetContentDownloadUrl call, as well as the cURL command issued.
Wow, did not know about a tool like this! I am totally putting my hands on it!
I finally was able to find out what the issue was. All our folders at the File Manager had spaces in it. By just replacing with "_" in the name of our folders I was able to fix it.
Thanks a lot for the support :-)