How to Give Users Access Through the Upload API?

cancel
Showing results for 
Search instead for 
Did you mean: 
draperaj
Member II

How to Give Users Access Through the Upload API?

Jump to solution

Hey Guys,

I'm working on an app, and in my app I have the user login, which gets an alfresco ticket from the url:

http://localhost:8080/alfresco/service/api/login?u=memedude&pw=ilovememes‍‍‍‍‍

The string I receive back from this is:

TICKET_9aa49e5ff12d3cba95d62b4cd21cfc27bda4f1f3‍‍‍‍‍


Then when I try to access the upload URL and pass this ticket in like this:

http://localhost:8080/alfresco/service/api/upload?alf_ticket=TICKET_9aa49e5ff12d3cba95d62b4cd21cfc27bda4f1f3‍‍‍‍‍‍

I receive back a 403 forbidden. I've tried doing this the exact same way, except I login with the admin's credentials:

http://localhost:8080/alfresco/service/api/login?u=admin&pw=admin‍‍‍‍


Works like a charm. I tried going into the Alfresco admin tools page, and I added the user into a group, and set a quota, and looked around. I'm still not able to get the user to pass authentication when I'm uploading the file.

How can I give these users the permissions to upload with the API, and not have to change the webscript to allow guests to download files?

Any tips / help would be appreciated guys,

Thanks!

1 Solution

Accepted Solutions
janv
Alfresco Employee

Re: How to Give Users Access Through the Upload API?

Jump to solution

I'm guessing that you're trying to upload to a target folder for which the user does not have write (add children) permission ? Here's a link to the deprecated API: File upload | Alfresco Documentation 

If you're using Community, then I would recommend that you test an upgrade to the latest release and try out the new Alfresco 5.2 REST APIs for uploading new content Alfresco API Explorer (Create Node).

Regards,

Jan

View solution in original post

2 Replies
fcorti
Alfresco Employee

Re: How to Give Users Access Through the Upload API?

Jump to solution

Hi,

Instead of changing the upload webscript you should evaluate to write your own webscript for your specific needs.

Changing the default Alfresco API is not a good choice.

I hope this helps you.

janv
Alfresco Employee

Re: How to Give Users Access Through the Upload API?

Jump to solution

I'm guessing that you're trying to upload to a target folder for which the user does not have write (add children) permission ? Here's a link to the deprecated API: File upload | Alfresco Documentation 

If you're using Community, then I would recommend that you test an upgrade to the latest release and try out the new Alfresco 5.2 REST APIs for uploading new content Alfresco API Explorer (Create Node).

Regards,

Jan