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 Tobias Lint · Dec 18, 2020 at 03:03 AM · CloudScriptContent

Uploading Images to CDN with CloudScript,

Hello,

I'm trying to store Images on CDN by managing them with CloudScripts.

I have already set it up, and it works just fine when I run it locally. But now I wanted to test it in the Cloud and got this Error: "CloudScriptAzureFunctionsArgumentSizeExceeded"

I guess this is because I am sending the Image within the FunctionParameter and if the function is run in the Cloud there is a limit? I find it a bit disappointing that this was error was not raised when I run locally...

Has anybody an Idea how I can pass the Image to the CDN without using an dedicated server or enabling AdminFunctions on the client?

Thanks a lot!

,

Comment
esk

People who like this

1 Show 0
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

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Dec 18, 2020 at 03:20 AM

You would need to write the image to an Entity File, and then pass the info about that file into the script. Either that, or pass the upload URL to the source (presumably the client). But I can't really recommend that path, since it would be trusting the client to upload a legitimate image file (a hacked client could upload anything it wanted to). At least having the script in that flow would allow you to do some basic checks of the data before committing it to CDN.

Comment
Tobias Lint

People who like this

1 Show 4 · 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
avatar image Tobias Lint · Dec 18, 2020 at 09:52 AM 0
Share

Thank you, I will check this solution out. I get that a hacked client may upload anything over this but I have only one cloud function that can upload a file and there are many checks on that data. For now I have a data limitation of 200Kb and its running through the Azure ContentModerator for an NSFW check. Do you think this is enough?

Thanks for the answer

avatar image Tobias Lint · Dec 19, 2020 at 07:35 PM 0
Share

Thank you, I implemented it and it works just fine ;)

avatar image esk · Aug 19, 2021 at 09:54 PM 0
Share

Can't a hacked client also just modify the cloudscript request in the same way and upload anything it wants?

avatar image SethDu ♦ esk · Aug 23, 2021 at 09:10 AM 0
Share

It is possible. Hence it is important to have verification steps before any data is changed on PlayFab. For example, Cloud Script/Azure Function has context in the argument, where caller information is stored. you may check the if this execution is valid to this player by reading values in context variable.

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

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    Updating Character Statistics Cloudscript 2 Answers

    Several questions related to Cloud Script & CDN 1 Answer

    Azure Function failed calling via Rules 2 Answers

    Attach URL at runtime to custom email template using cloud script 1 Answer

    How do I RegisterPlayFabUser from CloudScript,How do I register a new user from inside cloudscript 2 Answers

    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