How to execute custom Alfresco script on saving document opened via WebDAV or CIFS? - webdav

I want to open an Excel file to edit offline via WebDAV or CIFS and run my script at the Alfresco side to parse the content of the file when user saves a workbook.
Is it possible? How can I do this?

Use a content rule for inbound/updated documents. This way, regardless of which interface the user leverages to access documents (HTTP/WebDAV/CIFS/FTP) the rule will be triggered, and you can set it to "Execute Script" as an outcome.

Related

Edit word doc using webDAV

I am using webDAV and able to open the word file from server side. When I make some changes and save it, it is unable to save it on server and instead asking to save it on local. When I select to save it to web address it hits the webdavservlet but still it does not save it and ask to save locally.
Is there anything I am missing, is there any head or param that needs to be set. Or we need to call put method in webdav servlet, if yes how that can be made from ms-word when saved?
Thanks

Restrict Alfresco upload to specific file extension (ex: users can only upload PDFs)

I want to prevent my Alfresco 5.1 users from uploading anything else than ".pdf" and ".xslx" files.
What is the best way to implement that in Alfresco?
Is there a setting, or do I have to write some Java code?
Filtering must be done on the file extension, regardless of MIME types. The restriction must apply via FTP too.
You can't do this through simple Alfresco configuration. I'd suggest writing a Behaviour that would implement this logic. It will get triggered no matter how something ends up in Alfresco (Share, FTP, custom application, etc).
http://docs.alfresco.com/5.2/references/dev-extension-points-behaviors.html
You can not restrict throught FTP. Some ftp client provide file name filter facility,Using that you can Restrict.In alfresco try to create rule ,on that rule execute script ,that script contain code to delete file which is not allow.

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....
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.
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.

Preventing Users from Downloading file from website directly, how?

I need very advanced and effective method of Preventing Users from Downloading file from website directly in asp.net.
Method should -
limit downloads,
limit time,
limit requests,
etc.
but should be downloadable by active login users
Delete the file from the server.
Any user trying to download it will not longer succeed.
You can put your files into a directory and configure that directory as not accessible by public users.
Store the files in a folder which is not accessible via IIS (i.e., not underneath your web application's root)
Create an .ashx generic handler which takes a file identifier (either filename, or ID of some sort) as a QueryString parameter.
In that .ashx, perform whatever checks you want to perform: is the user logged in? have they downloaded too many files? etc.
Then, if you decide that they should be allowed to download it, set the response headers appropriately and write the file out to Response.OutputStream

Open File Dialog Asp.Net

I am creating an excel report in vb.net using the office interop. When the report is completed I am saving the excel file on the C drive. The users have asked to save file anywhere they want not just the c drive. Can someone give me some code to popup an opend file dialog in asp.net?
I want the dialog to popup in a saveAs in ASP.NET. I know how to do it in win forms, but I am creating an excel report in asp.net and calling the worksheet objects SaveAs property that excepts a fileName. So right now I just hardcode a file name in there. The users want to choose a file location
I think what you want is actually rather simple.
You can't save a file to the user's computer due to security restrictions (would you want a website saving a file to your computer?)
What you need to do is:
Complete report
Save report file to location on server, IE (.../myWebsite/files/GUID/myReport.rpt)
Display link on next screen pointing to the report file
Doing this the user can right-click and save the file to wherever they want on their computer.
You can clean up these files on whatever schedule you would like.
Assuming you are actually talking about a desktop, winforms app then you can use the built in FileSaveDialog.
Official documentation is here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx
but there are tons of tutorials explaining it out there:
http://www.google.co.uk/search?q=vb.net+savefiledialog
You can server files with the Open / Save dialog by using Response.TransmitFile().
The user is then presented with a save as dialog where they can choose the filename and the location on their computer.
You normally do this inside a HttpHandler. A simple one is described here:
http://blogs.msdn.com/petel/archive/2005/12/01/499189.aspx

Resources