file content -- uploading and overwriting files

LabKey Support Forum (Inactive)
file content -- uploading and overwriting files bront  2014-04-24 10:26
Status: Closed
 
hi,

I am having an issue with file uploads via the File Content module. LabKey won't permit files to be overwritten.

I seem to recall at some point that a dialog box would pop up warning of the overwrite, but that's no longer the case.

In the logs, I see that the overwrite is set to F...

POST /labkey/_webdav/xproject/@files/?Accept=application/json&overwrite=F

How can I change this so that users are warned if they are about to overwrite files but can choose to do so anyway?

Many thanks,

bront
 
 
Greg Taylor responded:  2014-04-28 10:06
Hi Bront,
Unfortunately, I couldn't find an option that would warn users on file overwrite. I suspect that the feature is no longer supported.
Greg
 
Greg Taylor responded:  2014-04-28 10:22
After more investigation, there is no option to enable this behavior but it should be enabled by default. On LabKey.org for example when I attempt to upload the same file twice I am prompted if the file should be replaced. Are you using the new file upload webpart that supports dragging and dropping your files into the browser?

Greg
 
bront responded:  2014-04-28 13:43
I thought that that was the default behavior in regard to replacing files.

We are not using the drag-and-drop functionality... just straight pick a file from your local and upload (via the FileContent tab).

When you upload on Labkey.org, can you see the log file? Does the POST indicate "overwrite=T"?

I really appreciate your help.

bront
 
jeckels responded:  2014-04-29 09:53
Hi Bront,

I just tested this on my local dev machine. I used Firebug to inspect the requests the browser is sending to the server.

Here's the sequence, using the single-file upload (click Browse, choose the file, click Upload):

Upload a new file to the server.
It does a POST to https://localhost/labkey/_webdav/home/%40files
Upload the same file to the server again.
Without sending any new requests, the browser pops up a dialog asking to confirm the overwrite.
It then does a POST to https://localhost/labkey/_webdav/home/%40files?overwrite=t

Thanks,
Josh