Tag: bootstrap file upload

如何获取由Bootstrap File Input插件创build的图像数据

我有下面的select和显示选定的图像,改变图像,取消它的工作。 所有这些都是由Bootstrap File Input插件完成的。 <div class="fileinput fileinput-new" data-provides="fileinput"> <div class="fileinput-new thumbnail"> <img src="http://www.placehold.it/512×512/EFEFEF/AAAAAA&amp;text=NO+IMAGE" alt="" class="img-responsive" /> </div> <div class="fileinput-preview fileinput-exists thumbnail"> </div> <div> <span class="btn default btn-file"> <span class="fileinput-new">Select image </span> <span class="fileinput-exists">Change </span> <input type="file" name="…" > </span> <a href="#" class="btn red fileinput-exists" data-dismiss="fileinput">Remove </a> </div> </div> 现在这个Bootstrap文件input插件创build下面的img元素,它保存图像的数据。 我需要这些数据,所以我可以使用AngularJS发送到我的节点服务器,并将该图像保存在我的服务器上的一个文件夹。 <div class="fileinput-preview fileinput-exists thumbnail"> <img […]

如何将jquery引导file upload插件中的自定义标头传递到节点服务器

我想传递一个标记字段和它的值以及file upload操作。 我正在使用Bootstrap文件input插件,但它不像其他默认头一样将自定义标头发送到nodejs服务器。 我已经尝试了下面的代码。 请帮我解决这个问题。 此代码与我的本地Apache服务器与基于PHP的代码正常工作,这个问题只显示在我的nodejs服务器,我使用的是sailsjs。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.3.1/css/fileinput.css" rel="stylesheet" type="text/css"><br> <link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.3.1/js/fileinput.min.js"></script> <script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> </head> <body> <input id="file-1" class="file" type="file" multiple data-preview-file-type="any"> <script> $("#file-1").fileinput({ uploadUrl: '#', // you must set […]