In short:
add_header Content-Disposition 'attachment; filename="foo.txt"';
We’re just adding a Content-Disposition
header in the response.
You can specify the file name, here we’re using foo.txt
.
// ==UserScript== | |
// @name remove-gray | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description remove gray theme | |
// @author You | |
// @match *://*/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net | |
// @grant GM_addStyle | |
// ==/UserScript== |
function randomStr(len) { | |
var str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', | |
strLen = str.length, | |
arr = []; | |
while (len > 0) { | |
var index = Math.random() * strLen, | |
a = str.slice(index, index + 1); | |
if (a) { | |
arr.push(a); | |
len--; |
import java.io.File; | |
public class DeleteFiles { | |
public static void deleteFiles( File file ){ | |
if( file.isDirectory() ){ | |
File[] files = file.listFiles(); | |
if( files.length == 0 ){ | |
file.delete(); | |
} else { | |
for( File f : files ){ |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |