使用SWFUpload v2.2,Firefox 3,IE 8,Flash 10在我的ASP.NET应用程序中,upload.aspx正在处理所有上传(我在设置对象中设置了正确的upload_url).在IE 8中,上传到upload.aspx页面并进行处理,但在Firefox中却没有.有什么建议?
此处显示了用户访问以上载文件的页面的大部分代码(注意:正在使用母版页):
<script type="text/javascript" src="../swfupload/swfupload.js"></script>
<script type="text/javascript" src="../js/handlers.js"></script>
<script type="text/javascript">
var swfu;
window.onload = function() {
swfu = new SWFUpload({
// Backend Settings
upload_url: "../upload.aspx",
post_params: {
"ASPSESSID": "<%=Session.SessionID %>"
},
// File Upload Settings
file_size_limit: "10 MB",
file_types: "*.*",
file_types_description: "All Files",
file_upload_limit: 1,
file_queue_limit: 1,
//assume_success_timeout: 60,
// Event Handler Settings - these functions as defined in Handlers.js
// The handlers are not part of SWFUpload but are part of my website and …Run Code Online (Sandbox Code Playgroud) 我有一个 html 表单。我想给它添加一个简单的图片上传功能,它会将图片发送到一个名为“next.php”的 php 页面。关于如何做到这一点的任何建议?
androids DownloadManager是否有对应版本?我想开始上传文件,并且当应用被终止时,上传应该继续。它应该提供类似的可能性,例如设置标题,进度通知,通知中心集成等。
我找到了https://github.com/alexbbb/android-upload-service,但它使用的是ServiceIntent。因此,当应用被终止时,它将停止工作。还是我理解不对?
如果没有对手:编写独立于应用程序状态运行的后台服务的最佳方法是什么?我看过Services,AsyncTask,ServiceIntent,但是当应用程序死后,所有这些都将停止!
service android background-service kill-process asyncfileupload
我在我的项目中使用webapi上传文件.我正在和邮递员一起测试.但是,Request.Content.IsMimeMultipartContent()始终返回false.
邮差截图:
FileUploadController代码:
public async Task<HttpResponseMessage> UserImageUpload()
{
try
{
if (!Request.Content.IsMimeMultipartContent())
{
throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
}
var userImageUploadPath = HttpContext.Current.Server.MapPath(CommonParameters.UserProfileImageServerPath);
var streamProvider = new CustomMultipartFormDataStreamProvider(userImageUploadPath);
await Request.Content.ReadAsMultipartAsync(streamProvider);
var files = new List<string>();
foreach (MultipartFileData file in streamProvider.FileData)
{
files.Add(Path.GetFileName(file.LocalFileName));
}
return Request.CreateResponse(HttpStatusCode.OK, files);
}
catch (Exception exception)
{
logger.ErrorFormat("An error occured in UserImageUpload() Method - Class:FileUploadController - Message:{0}", exception);
return Request.CreateResponse(HttpStatusCode.BadRequest);
}
}
Run Code Online (Sandbox Code Playgroud) 我想要在后台上传文件,一旦开始处理文件上传,就不会影响页面的主要使用。
除此之外,我们希望能够在不中断上传的情况下从执行上传的页面导航到应用程序中的其他页面。
我已经使用 Web worker/SharedWorker 实现了它,以在后台使用 XMLHTTPRequest post 请求将文件对象发送到服务器。在启动上传并且没有导航到其他页面时它工作正常。但是在从 page1.html 开始上传后导航到 page2.html 时, request.getPart() 在服务器端返回 null 并且上传失败。
使用sharedWorker提交的任务在导航到同一域中的其他页面时是否停止/暂停?
为什么 request.getPart() 在导航到其他页面时返回 null,因为在导航到同一域中的其他页面时,sharedWorker 仍必须运行?
我的应用程序的结构是:
我们如何实现以下功能:
任何链接/建议都将非常感激。
谢谢,曼普雷特
有一个按钮(MyButton).单击此按钮会出现一个modalpopup(MyPopup),其中包含一个asyncfileupload ajax控件,"确定"按钮和"取消"按钮.
asyncfileupload功能的浏览功能正常,没问题.但是在回发之后,如果我再次单击MyButton,弹出窗口将出现在asyncfileupload控件的文本框中的上一个路径中.
如何清除它......!
提前致谢.
我正在使用AsyncFileUpload以允许用户异步上传文件.
我想将文件的大小限制为1MB.
到目前为止,我看到的只能在上传完成时得到文件的长度
比如上传开始时:
(OnClientUploadStarted)
function UploadStarted(sender,args)
{
//if bigger than 1MB (approximately)
if (args.get_length() > 1000000 )
{
ShowActionNotificationError( errorMessage);
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
args.get_length()为null,所以我不能使用它...
上传完成后:
(OnClientUploadComplete)
function UploadComplete(sender,args)
{
//if bigger than 1MB (approximately)
if (args.get_length() > 1000000 )
{
ShowActionNotificationError( errorMessage);
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
工作正常,但文件已经上传...
那么在上传之前如何知道文件的大小呢?我错过了一些非常简单的事吗?
我真的想在不处理HTTP请求长度和排序的情况下这样做.
谢谢!
我正在使用jQuery Forms插件来执行异步文件上传.目前,用户中止上传的唯一方法是按下浏览器上的"停止"按钮,这可能会导致其他javascript和ajax请求停止.我想提供一个取消按钮,但我没有找到任何方法取消上传,因为它正在使用API 发生.
是否存在内置方式,或者至少可以使用强大的黑客来取消上传?
我们使用的是asp.net的Asyncfileupload控件来上传文件,同样不行我们调试了一下,发现这样的代码:
input.Read(buffer, 0, buffer.Length)
Run Code Online (Sandbox Code Playgroud)
返回 0。
整个代码是这样的:
public static byte[] ReadFully(Stream input)
{
byte[] buffer = new byte[input.Length];
using (MemoryStream ms = new MemoryStream())
{
int read;
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
{
ms.Write(buffer, 0, read);
}
return ms.ToArray();
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试将文件上传到 S3,文件已成功上传,但下载时它包含 WebKitFormBoundary
------WebKitFormBoundaryrTBzWaHQntWAtZLX
Content-Disposition: form-data; name="file"
hello world
------WebKitFormBoundaryrTBzWaHQntWAtZLX--
Run Code Online (Sandbox Code Playgroud)
使用 axios 上传
const formData = new FormData();
formData.append('file', this.file);
this.axios.put(this.formUrl,
formData,
{
headers: {
// 'Content-Type': `multipart/form-data`,
'Content-Type' : 'application/octet-stream',
},
})
.then((res) => {
Run Code Online (Sandbox Code Playgroud)
console.log(res) }).catch((e) => { console.error(e) });
如何去除边界
我正在尝试使用文件预览找到某种用于Ajax上传的插件.图像将保存到MySQL数据库中.这甚至可能吗?我猜所有事情都有可能满足某些要求.你有没有遇到过这样的事情?
我一直在学习如何使用asp.net ajax控件工具包提供的不同控件.
我遇到了两个让我很困惑的控件:
AjaxFileUpload和2 AsyncFileUpload.第一个控件非常好.据我所知,与普通的asp.net文件上传控件不同,AjaxFileUpload上传的文件没有回发
但是,我不确定这个AsynxFileUpload又是什么.我无法理解它们之间的区别
任何人都可以在此清楚我.如果可能,任何一个例子
谢谢
asyncfileupload ×12
file-upload ×4
ajax ×3
asp.net ×3
javascript ×2
php ×2
.net ×1
android ×1
asp.net-ajax ×1
axios ×1
filestream ×1
firefox ×1
forms ×1
image ×1
java ×1
kill-process ×1
memorystream ×1
postman ×1
service ×1
swfupload ×1
web-worker ×1