How to upload files to LabKey asynchronously

LabKey Support Forum
How to upload files to LabKey asynchronously jlumpe  2015-02-21 17:50
Status: Closed
 
I'd like to have the user upload some files to LabKey using a custom view. These would be placed in the file system in the standard way, just like when you upload them yourself using the FileContent module, but I don't want the user to see or have control over where they are uploaded. According to this PDF I found it looks like it's possible to do so with a POST request to a URL like "/labkey/_webdav/ProjectName/%40files/path/" or something but I haven't been able to figure it out. Basically I just want to render a view with a file input, with a button that uploads the file to a given folder the user has no control over. Is it possible?
 
 
jeckels responded:  2015-02-22 01:12
Hello, Yes, that's quite possible. There's some example code in the documentation here: https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Exp.Data.html#constructor It shows both uploading a file directly from the user's file system, as well as uploading a text file that the user pasted into a form field or similar. Thanks, Josh