Skip to content
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

File Upload still works when "explorer.enableDragAndDrop" is false #109057

Closed
mklechan opened this issue Oct 21, 2020 · 8 comments
Closed

File Upload still works when "explorer.enableDragAndDrop" is false #109057

mklechan opened this issue Oct 21, 2020 · 8 comments
Assignees
Labels
file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@mklechan
Copy link

  • VSCode Version: 1.49.3
  • OS Version: Mac OS

Steps to Reproduce:

  1. In settings set "explorer.enableDragAndDrop" to false
  2. Drag file from Mac File Explorer to Editor Window
  3. Note the file can now be edited and saved to remote or local machine

Does this issue occur when all extensions are disabled?: Yes

@isidorn
Copy link
Contributor

isidorn commented Oct 22, 2020

That setting only affects drag and drop from within the explorer.
I understand the setting name might be confusing.
And that it might also disable drag and drop from desktop to vscode.

However for now leaving this open to get more user feedback.

@isidorn isidorn added file-explorer Explorer widget issues under-discussion Issue is under discussion for relevance, priority, approach labels Oct 22, 2020
@isidorn isidorn added this to the Backlog milestone Oct 22, 2020
@mklechan
Copy link
Author

Hi @isidorn , thanks. Is there a setting to disable file upload and download from the Desktop to VSCode?
If not could you point me to the module that handles this? That way i can understand if i could do this myself.

@isidorn
Copy link
Contributor

isidorn commented Oct 22, 2020

No, there is no setting for this.
Here's the code that handles this

this.dropEnabled = this.configurationService.getValue('explorer.enableDragAndDrop');

I think the change should be simple, I am not sure if it would cause user backlash. So a clean PR is probably welcome.

fyi @bpasero since he originaly introduced the enableDragAndDrop setting

@bpasero
Copy link
Member

bpasero commented Oct 23, 2020

The original intent of enableDragAndDrop setting was really to prevent accident changes in the explorer when you drag-and-move in the explorer. It has nothing to do with uploading from the desktop. I would not change anything here.

@isidorn
Copy link
Contributor

isidorn commented Oct 23, 2020

Makes sense.
Then the only thing we could do is improve the setting description.

@isidorn
Copy link
Contributor

isidorn commented Nov 10, 2020

As discussed I have only pushed a clarification of the setting.
No further changes are planned thus closing this.

@isidorn isidorn modified the milestones: Backlog, November 2020 Nov 10, 2020
@mklechan
Copy link
Author

mklechan commented Dec 1, 2020

@isidorn I was able to stop file uploads by setting MAX_FILE_UPLOAD_SIZE to 0
with enableDragAndDrop set to false I can stop uploads to both the Editor and the Explorer.

But I can still download files from VSCode to my Mac by dragging and dropping. Is there a better place in the code to stop this?
I was looking at:

async download(resource: URI, target: URI, cancellationToken: CancellationToken = CancellationToken.None): Promise<void> {

But that doesnt seem to work

Thanks

@isidorn
Copy link
Contributor

isidorn commented Dec 1, 2020

@mklechan we do not have plans to change this at the moment, so even if you create a PR, we would probably not merge this in.
As for the code pointer, here is where the drop is handled

this.compressedDropTargetDisposable.dispose();

@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

4 participants
@bpasero @mklechan @isidorn and others