logo
Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
bart  
#1 Posted : Wednesday, October 9, 2013 1:41:39 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 188
Man

Was thanked: 1 time(s) in 1 post(s)
If you want to Secure downloadable files so people who aren't loged in this is possible.
There is a userescape in which you can define the rules for files to download.
The only requirement is, the file should be in files(download) not in Photo.

for files you can select the "Secure" checkbox to use the userescape for downloading this file.
If this checkbox is disabled the file isn't secure and can be downloaded by everyone. However, if the file isn't listed in Sienn but for instance added through ftp or something, this userescape also kicks in so you still can determine who can download files and who can't.

this userescape you can find in "Development/Grobal functions/Userescape download secure event".
an example of this userexcape where "zip" files only can be downloaded by registrated IP addresses.
Code:
try
  if filename.toupper.indexof(".ZIP")>=0 then
    'Doe ipcheck
    Dim hostnummer as string = httpcontext.current.Request.ServerVariables("REMOTE_HOST").ToString.trim
    Dim Con As New SqlConnection(constring)
    Dim Query As String = "SELECT COUNT(*) FROM XXU_GrantedDownload  WHERE Actief=1 and SERVERIP='" & hostnummer & "'"
    Dim Com As New SqlCommand(Query, Con)
    Con.open()
    Dim aantal as integer = -1
    try
      Dim Reader As SqlDataReader = Com.ExecuteReader()
      Reader.Read()
      aantal = reader.getint32(0)
    catch
    end try
    Con.close()
    if aantal>0 then
      return true
    else
      return false
    end if 
  else
    return true
  end if
catch
  return false
end try

Wanna join the discussion?! Login to your Sienn Forum forum account. New Registrations are disabled.

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.