This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'tom' | |
import sys | |
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplication | |
class Example(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.init_ui() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// XMLHttpRequest | |
var xhr = new XMLHttpRequest(); | |
xhr.open('POST', url, true); | |
xhr.responseType = 'arraybuffer'; | |
xhr.onload = function () { | |
if (this.status === 200) { | |
var filename = ""; | |
var disposition = xhr.getResponseHeader('Content-Disposition'); | |
if (disposition && disposition.indexOf('attachment') !== -1) { | |
var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; |