Advanced file sharing

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
1/2/2011 10:20:40 AM
Gravatar
Total Posts 192

Advanced file sharing

There are two things I need with the file sharing module...

1. I need to limit the total upload size for site users. currently specifying a size limit for a role suffices for me.

2. I want a special role to be able to upload files. but they must not have perfect permission. they must just be able to upload upto the permitted limit, they must be able to delete their own files. but they  mustn't be able to delete other users uploaded files.

(instead of limiting upload size, having workflow available would also be good. for example uploaded  files need to be approved by admin, and if not approved they will be removed after 3 days from server.)

I thought about cloning file sharing and developing my own.

maybe the changes are useful for others too.

suggestions?

(and how can I send the extended file sharing to you after it's available?)

1/3/2011 2:28:31 PM
Gravatar
Total Posts 192

Re: Advanced file sharing

Where are these settings used?

<add key="UserFolderDiskQuotaInMegaBytes" value="300"/>

<add key="UserFolderMaxNumberOfFiles" value="1000"/>

1/3/2011 2:59:15 PM
Gravatar
Total Posts 550

Re: Advanced file sharing

Hi,
In the site settings under Securiy ->Permission  you can  specify roles that can browse and upload files but only in a user specific user folder. Those setting apply to user specific user.

Hope Helps,

Asad

1/3/2011 3:39:28 PM
Gravatar
Total Posts 1201
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Advanced file sharing

Paiman, you can add those keys to your user.config file, then override the values. Use Asad's tip to set up per-user upload directories for quota enforcement.

1/4/2011 6:34:20 AM
Gravatar
Total Posts 192

Re: Advanced file sharing

I have set those permissions to the roles. but how can they access the file manager?

they are not allowed to access site/Dialog/FileManagerDialog.aspx and neither site/Dialog/FileManagerAltDialog.aspx

how are they supposed to access the filemanager itself?

and those permissions are not applied to file sharing module.

what am I doing wrong?

1/4/2011 6:50:24 AM
Gravatar
Total Posts 18439

Re: Advanced file sharing

Those settings do not apply to the Shared Files module.

The Shared Files feature is not intended for user specific files nor for files used in html content such as images, it is designed for sharing files by roles and protecting those files so they cannot be downloaded by users who are not in allowed roles. It does this by storing the files on disk with a guid for the name and with the extension .config and the real file name is stored in the database. .config extension is protected so it cannot be downloaded from an url even if you can guess the correct file name and location.

Roles specified under Roles That Can Browse and Upload but only in a user specific location can browse and upload files such as images using the wysiwyg editor (if they also have some edit permissions in content or in forums). 

In order for users to have access to the file manager, they also need to be in "Roles that Can Delete Files Using The File Browser in the Editor". This is because the File Manager does allow deleting files so in order to allow use of it the user must be allowed to delete files. Of course they still can only delete file sin the user specific location.

Files in file manager are meant for use in html content and as such they are not protected by a .config extension so if someone knows the url path to the file it can be downloaded, it is not protected in any way.

Hope it helps,

Joe

1/4/2011 8:08:00 AM
Gravatar
Total Posts 192

Re: Advanced file sharing

Thanks.

now I have a problem!

I want users to be able to upload pdf files as well as doc and docx and some other files.

I added this to user.config:

<add key="AllowedLessPriveledgedUserUploadFileExtensions" value=".gif|.jpg|.jpeg|.png|.zip|.pdf|.doc|.docx|.xls|.xlsx|.ppt|.pptx|.csv|.txt"/>

now in the editor for upload, when a less priveledged user wants to upload a pdf file, neat upload is shown and seems it finished it's job.

but nothing will be added to the user folder.

(there is no problem with the jpg file)

editor is: TinyMCE

 

1/4/2011 8:10:00 AM
Gravatar
Total Posts 192

Re: Advanced file sharing

it happens with CKEditor too.

1/4/2011 8:56:39 AM
Gravatar
Total Posts 18439

Re: Advanced file sharing

Are you trying to upload files that are not images from the image dialog in the editor? You can only upload images there. To upload other file types you need to use the link button in the editor, ie highlight some text to be the link then click th elink button then you can browser the server and upload file and link to it.

Hope it helps,

Joe

1/8/2011 6:10:10 AM
Gravatar
Total Posts 192

Re: Advanced file sharing

ok. uploading from the editor is not what I wanted. so I will make changes to sharedFiles feature.

I will make these changes to it:

add three more setting options to sharedfiles:

  • allow all authenticated users to upload files
  • User quota
  • allow users to delete the files they uploaded themselves

(the first could later be changed to allow specific roles, and also the second to specify disk quota for roles)

currently only the roles which can edit are allowed to upload files. and they also can edit the page.

in a more advanced way, could add a single option whether to follow global file upload settings or not; later.

for these three, none of them require a DB change.

if implemented, will you integrate it to the existing feature, or I must consider cloning it first?

(and I don't still know how to send changes to you)

(also how can I directly contact you? I guess there are security issues with sharedfiles feature that I can't post here)

 

1/8/2011 12:45:56 PM
Gravatar
Total Posts 18439

Re: Advanced file sharing

If you add users to roles that can upload to user location and also add them to roles that can delete files in the editor, then they will be able to use the real file manager that is intended for users and will see the file manager link in the toolbar at the bottom of most skins.

Shared Files feature is not meant for user files and I don't want to make it for user files so if you want to customize it you should clone it into a separate independent feature then you can modify it as a custom feature as much as you like with no problems and still be able to upgrade.

Small code changes can be submitted here in the forums and if I agree I will integrate them. Larger changes require a contributor agreement, see contribution guidelines here:

http://www.mojoportal.com/contribute.aspx

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.