-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload in file-drop public link flattens folder hierarchy #2443
Comments
@skshetry mind trying this with OC 10 ? as far as I remember we don't support subdirectories in files drop mode so this might be expected behavior |
not a requirement imo, it would mess up the concept and make it more complex as we'd need to avoid file name collisions even across folders. @pmaier1 thoughts ? |
@pmaier1 please reopen if you think we want to change how it works in Phoenix |
@PVince81, then, I would not expect the contents of sub-folders getting uploaded in the root of the publicly-shared folder (at least they should be in their respective sub-folders). Re-opening, feel free to close if you don't think, that is an issue. |
@skshetry you're right. We need to block this with a warning. |
@skshetry could you retry this with all the changes that have occured in the last ~1,5 years? Should work fine now 😉 |
@pascalwengerter, uploading folders seems to work but all the files in the folder will be flattened.
it will upload all 3 files Uploading a similar folder in the main files section keeps the folder structure of the originally uploaded folder. |
@pascalwengerter |
No, should upload the folder including files & subfolders the way they were structured before |
Uploads have been mostly re-implemented in a recent pull request (#6202). Issue still seems to be present. Since this corrupts uploaded data / modifies uploaded data in an unexpected way I've decided to elevate this to a P1. |
We noticed some inconsistencies between oC10 and oCIS when uploading contents to a public drop-page: When uploading a file that already exists, oC10 will create a new file with a suffix (e.g. |
Thanks for pointing at this. IMO the oC10 behavior is correct. Main reason for that is that we should cover for the case that occurs when multiple people upload files with the same name to a file drop link. In that case it does not make sense to create versions as the files most probably really are distinct except that they have the same name. Same behavior for folders then. Apart from that, I think the versioning feature should not be exposed at all in the context of a (public) link. |
Found it
The behavior is described, discussed and agreed there. cc @micbar |
Thx for the input! Then I guess Web just sends the data to oCIS, which checks and handles the duplicate case. Technically, this is a bit challenging for folders. Because with folder uploads, Web first creates all folders and then uploads resources to those. Now if oCIS stored |
The response to the initial create of a folder is going to return some HTTP status 2nn. The response could also have the actual "allocated" resource name as a data item in the response body. Then the client can know what name the folder has, and can then create the rest of the folder structure under that folder name. The other approach would be that if the folder already exists, then the server can respond with something like 409 "conflict", and in the response body provide a suggested alternative folder name |
There is also a security concern about not disclosing what files&folders are present in whatever folder you create a dropLink for - which means the backend should "silently swallow" whatever the public uploads there and then handle renaming backend-only |
I'm all in favor of letting the backend handle this, hence the first approach sounds good to me:
However, either way, the client will know that there is a resource with that exact name. I'm not sure if that is information we want to publish to the outside world. |
Can't we handle subsequent (child folder) uploads based on the resourceId of the previously uploaded (parent) resource, hence not disclosing anything about potential renaming happening? |
Exactly, this is important. Clients must not have any way to infer the content of the file drop folder. |
That sounds promising - the response to the "create resource" request can provide a resourceId which is a "magic string" unrelated to the resource name. The client can then create child resources under that. |
Good idea, AFAIK this would need to be implemented first though. The ownCloud SDK (and oCIS itself?) only works with paths and names. |
I researched a bit on how things work and what needs to be done if we aim for this solution. There's quite a lot unfortunately:
|
This issue doesn't seem to occur in latest master. Upload folder to public link share works fine and also the issue mentioned in this comment #2443 (comment), the structure of the folder is not affected.
The folder is uploaded with the same folder structure. The folder upload is currently not supported in playwright, so only tested manually. So, closing this issue for now. |
Steps to reproduce
Expected behaviour
Some way to upload folder
Actual behaviour
No way to upload a folder. Dragging a folder uploads the contents of the folder (recurse through it and flattens them).
Also, using
setValue
and trying to upload folder throughNightwatch
creates an empty file.The text was updated successfully, but these errors were encountered: