Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by YuKim · May 24, 2019 at 04:46 AM · unity3dContent

CDN upload is not work

Download content is working but upload content is not working

I upload file name "25.bin"

first upload is work activate

but download that does not work

website is not displayed "25.bin".

"Bin2.bin" is uploaded with UPLOADFILES Button in website

Bin2.bin is no probelm to downlaod

why this error occur?

11111111.png (8.7 kB)
111112.png (8.2 kB)
Comment

People who like this

0 Show 1
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image YuKim · May 24, 2019 at 04:51 AM 0
Share
    void LaterStart()
    {
        string Keyname = "25.bin";
      UploadFileToCDN(Keyname);
    }

    public void UploadFileToCDN(string key, byte[] content, string contentType = "binary/octet-stream")
    {
        GetUploadUrl(key, contentType, presignedUrl =>
        {
           PutFile(presignedUrl, content,contentType);
        });
    }


    void GetUploadUrl(string key, string contentType, Action<string> onComplete)
    {
        PlayFabAdminAPI.GetContentUploadUrl(new GetContentUploadUrlRequest()
        {
            ContentType = contentType,
            Key = key
        }, result => onComplete(result.URL),
        error => Debug.LogError(error.GenerateErrorReport()));
    }    void PutFile(string presignedUrl, byte[] content, string contentType = "binary/octet-stream")
    {
        WWWForm form = new WWWForm();
        form.AddBinaryData("Data", content);


        UnityWebRequest www = UnityWebRequest.Post(presignedUrl, form);
        if (www.isNetworkError || www.isHttpError)
        {
            Debug.Log(www.error);
        }
        else
        {
            Debug.Log("Form upload complete!");
        }


    }

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Hernando · May 28, 2019 at 07:16 AM

I noticed that you use POST method to update data in your code. Actually, we provide very detailed tutorial about CDN: https://api.playfab.com/docs/tutorials/landing-content/cdn and it has mentioned that you must make HTTP PUT request to update data.

So we recommend editing your code base on this then trying to upload your data. If this problem still occurs in your latest test, network tools such as Wireshark can help you to check if there is any SSL connection issue between PlayFab server and you.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    How to download content from cdn? 1 Answer

    I make project mesh upload Donwload project and error is occured upload download 0 Answers

    GetContentDownloadUrl download file failed access denied 1 Answer

    Slow response times 1 Answer

    Best Approach for getting leaderboards (Login by FB) 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges