Add upload file from url

This commit is contained in:
2021-07-13 14:29:39 +02:00
parent 360a7c112f
commit 673f0433ed
3 changed files with 81 additions and 1 deletions

View File

@ -55,6 +55,26 @@ function handleFiles(files) {
files.forEach(previewFile)
}
//upload file from url
$('#url').keypress(function (e) {
if (e.which == 13) {
var url = encodeURIComponent($('#url').val());
$.get({
url: 'uploadUrl.php',
data: 'url=' + url,
beforeSend: function(){
lock = 1;
},
success: function(data, statut) {
lock = 0;
listFile();
},
error: error,
});
return false;
}
});
function uploadFile(file) {
let url = 'upload.php'
let formData = new FormData()