File Request Limitations

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

chaus
Posts: 2
Joined: 17 Dec 2017, 22:11

File Request Limitations

Postby chaus » 17 Dec 2017, 22:19

Hello,

I am trying to implement file upload feature to my test server by following "Uploading files with SmartFoxServer 2X" tutorial.

I want to confirm if there is a way to filter who can request files from Jetty server. For example only loggedin users shall be able to download the file or upto user details like point etc.

Thanx
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: File Request Limitations

Postby Lapo » 18 Dec 2017, 09:04

Hi,
uploads are only possible if you're a logged in user by default.

As regards downloads it's a bit different. Files are downloaded using HTTP via a url which you provide in form of a link to the user.
Since users don't know how to request a file download it depends on your application logic to provide the link to a download to a certain category of users but no others.

This is pretty simple to implement using the "user privilege" attribute that every User object provides. In other words you can assign different "roles" to different users and then allow some of these to access certain files.

For more details on user privilege management you can take a look here:
http://docs2x.smartfoxserver.com/Advanc ... ge-manager

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
chaus
Posts: 2
Joined: 17 Dec 2017, 22:11

Re: File Request Limitations

Postby chaus » 18 Dec 2017, 09:38

Thank you for your reply Lapo.

Let me think... Will it be possible to interact with server if i writes my own web aplication?

I mean is it possible to ask user privileges to sfs2 from my own simple asp page and request files with usertoken from game?

By this way i can control privileges strictly and prevent cheating as much possible.

Thank you so much.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 52 guests