In my app I am loading users that are online for the web app in other sessions… Along with the user, their picture is displayed. Loading their information is going fine but I am having a problem loading up the location of their image and loading it to a web picture so it can display in the listbox. However, I am getting an illegal cast error. Can anybody help with what I am doing wrong? BTW p is a WebPicture. Here is my code:
If sUsersOnline_Usernames.Ubound > -1 Then
For i As Integer = 0 To sUsersOnline_Usernames.Ubound
fPictureFolder = GetFolderItem(sUsersOnline_PicturePath(i))
If fPictureFolder <> Nil Then
If fPictureFolder.Exists And fPictureFolder.IsFolder Then
fPictureFile = fPictureFolder.Child(sUsersOnline_PictureName(i))
End If
End If
If fPictureFile <> Nil Then
If fPictureFile.Exists Then
p = WebPicture(fPictureFile)
Else
p = NoUserImage50
End If
Else
p = NoUserImage50
End If
s=sUsersOnline_Usernames(i) + ", " + EndOfLine
s=s+sUsersOnline_UserTitle(i) + EndOfLine
s=s+sUsersOnline_UserSchool(i)
ListBox_UsersOnline.AddRow(sUsersOnline_UserRegID(i),"", s)
ListBox_UsersOnline.CellPicture(ListBox_UsersOnline.LastIndex, 1) = p
Next
End If
Okay I changed the permission for the file but still get the same thing. Here is the code.
If bLoginUsersChanged Then
sUsersOnline_Usernames.SortWith(sUsersOnline_UserRegID, sUsersOnline_UserSchool)
Listbox_UsersOnline.DeleteAllRows
If sUsersOnline_Usernames.Ubound > -1 Then
For i As Integer = 0 To sUsersOnline_Usernames.Ubound
fPictureFolder = GetFolderItem(sUsersOnline_PicturePath(i))
If fPictureFolder <> Nil Then
If fPictureFolder.Exists And fPictureFolder.IsFolder Then
fPictureFile = fPictureFolder.Child(sUsersOnline_PictureName(i))
fPictureFile.Permissions = &o777
End If
End If
If fPictureFile <> Nil Then
If fPictureFile.Exists Then
p = New WebPicture(fPictureFile)
Else
p = NoUserImage50
End If
Else
p = NoUserImage50
End If
s=sUsersOnline_Usernames(i) + ", " + EndOfLine
s=s+sUsersOnline_UserTitle(i) + EndOfLine
s=s+sUsersOnline_UserSchool(i)
ListBox_UsersOnline.AddRow(sUsersOnline_UserRegID(i),"", s)
ListBox_UsersOnline.CellPicture(ListBox_UsersOnline.LastIndex, 1) = p
Next
End If
bLoginUsersChanged = False
End If
i believe files you not own can only be changed in permissions by super user in linux.
linux have also permissions Groups.
i would make a test window with a button and try to open the file.
i have no experience with xojo cloud.