question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GM_download cannot generate folder

See original GitHub issue

What is the problem?

GM_download cannot generate folder

It should be a mistake to replace the / symbol with _ In the browser API chrome.downloads.download, when the parameter file is AA/abc.jpg, an AA folder will be generated

How to reproduce it?

// ==UserScript==
// @name          GM_download Test
// @namespace     https://github.com/qinxs
// @author        qinxs
// @version       1.0.0
// @description   GM_download cannot generate folder
// @include       http*
// @run-at        document-start
// @grant         GM_download
// ==/UserScript==

'use strict';

GM_download({
  url: 'https://cdn.jsdelivr.net/gh/qinxs/cdn-assets@master/img/md/b04c6f46/workmodel.png',
  name: 'md/workmodel.png',
  saveAs: false,
});

What is the expected result?

Generate the folder md, and the picture ‘workmodel.png’ is stored in the md folder

What is the actual result?

The file md_workmodel.png is generated

What is the result in the upcoming release? WARNING! Do an export in settings before testing!

Environment

  • Browser: Firefox & Chrome
  • Browser version: 78.15esr & 90.0.4430.93(正式版本) (64 位)
  • Violentmonkey version: 暴力猴 v2.13.0
  • OS: Win 7(x64)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tophfcommented, Nov 18, 2021

The code that deals with requests should be in the request.js. The code that shows the option should be in the file that contains the options, probably inside Advanced.

0reactions
milklikercommented, Nov 18, 2021

got~ thanks! I will add these and create pull request later…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get a "could not create download directory" error ...
Scroll down to the Downloads section and and click Change. 5. Select a Downloads Location. You will need to do this even if...
Read more >
Cannot create directory download directory. Make sure it ...
Cannot create directory download directory. Make sure it can be created ... Normal downloads via internet pages are going to downloadsfolder.
Read more >
Safari Downloads - Cannot Create File
Open the General section of Safari's preferences and check where Safari is trying to download files to; if this folder doesn't exist or...
Read more >
Fix: Can't Create New Folder in Windows 10 [Option Missing]
What to do if I can't create new folders in Windows 10? · 1. Edit the Registry manually · 2. Uninstall problematic applications...
Read more >
Can't Create a New Folder in Windows 10? Here's How to ...
Another workaround for your problem is to use Command Prompt to create a new folder. Launch Comand Prompt with administrative rights and type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found