mahesh
mahesh

Reputation: 597

Get the uploaded document url through alfresco

I am very new to alfresco(using version 3.4). I have written a document library action to validate the uploaded file. Now I want path of uploaded file so that I can pass it to my service to validate. Can any one tell me how could I get the downloadable path of a document ??

THanks....

Upvotes: 1

Views: 2412

Answers (2)

Zlatko
Zlatko

Reputation: 19569

The URL download path? If you know the nodeRef of the document, you can construct the path yourself.

Here's an example:

http://localhost/share/proxy/alfresco/api/node/content/versionStore/version2Store/169c2842-6bc8-4ace-9b9f-1a46aebb100b/MyFile.pdf?a=true

Everything up to and including the "version2Store" is fixed, and then you have the nodeRef/file part. That's the download link for a document (assuming the user is logged in and can have access to the document or the document is accessible for guests.

Upvotes: 0

Tahir Malik
Tahir Malik

Reputation: 6643

I don't know how you've build your action. But on the client side Javascript you could access file.path.

On the repository side webscript, the normal action imports action.lib.js. In which the path variable is available.

If you take a look at e.g. Backup Action in the googlecode project share-extra's then you'll probably will know what I mean.

Upvotes: 1

Related Questions