hamed_hossani
جمعه 10 آذر 1391, 20:19 عصر
سلام
دمو (http://blueimp.github.com/jQuery-File-Upload/)
در این قسمت اگه وقت کنم اموزش می گذارم.
Features
Multiple file upload:
Allows to select multiple files at once and upload them simultaneously.
Drag & Drop support:
Allows to upload files by dragging them from your desktop or filemanager and dropping them on your browser window.
Upload progress bar:
Shows a progress bar indicating the upload progress for individual files and for all uploads combined.
Cancelable uploads:
Individual file uploads can be canceled to stop the upload progress.
Resumable uploads:
Aborted uploads can be resumed with browsers supporting the Blob API.
Chunked uploads:
Large files can be uploaded in smaller chunks with browsers supporting the Blob API.
Client-side image resizing:
Images can be automatically resized on client-side with browsers supporting the required JS APIs.
Preview images:
A preview of image files can be displayed before uploading with browsers supporting the required JS APIs.
No browser plugins (e.g. Adobe Flash) required:
The implementation is based on open standards like HTML5 and JavaScript and requires no additional browser plugins.
Graceful fallback for legacy browsers:
Uploads files via XMLHttpRequests if supported and uses iframes as fallback for legacy browsers.
HTML file upload form fallback:
Shows a standard HTML file upload form if JavaScript is disabled.
Cross-site file uploads:
Supports uploading files to a different domain with Cross-site XMLHttpRequests.
Multiple plugin instances:
Allows to use multiple plugin instances on the same webpage.
Customizable and extensible:
Provides an API to set individual options and define callBack methods for various upload events.
Multipart and file contents stream uploads:
Files can be uploaded as standard "multipart/form-data" or file contents stream (HTTP PUT file upload).
Compatible with any server-side application platform:
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.
منبع:
https://github.com/maxpavlov/jQuery-File-Upload.MVC3/downloads
https://github.com/i-e-b/jQueryFileUpload.Net/downloads
------------------------------------------------------------------------------------------
نحوه استفاده:
باید در 4 .net باشه
من پوشه ای ب نام jqueryFileUpload در app-code ساختم و فایل های ashx.cs را درونش کپی کردم و در
<%@ WebHandler Language="C#" CodeBehind="jqueryFileUpload/FileTransferHandler.ashx.cs" Class="jQueryUploadTest.FileTransferHandler" %>
codeBehine را تغییر دادم
مسیر StorageRoot در فایل FileTransferHandler.ashx.cs برای ذخیره کردن فایلها مورد استفاده قرار میگیره
public string StorageRoot
{
get
{
//writed by hamed.hossani@gmail.com
return HttpContext.Current.Server.MapPath("~/files/");
// ConfigurationManager.AppSettings["StorageRoot"];
}
}
مسیر HandlerPath در FilesStatus.ashx.cs برای بارگزاری اطلاعات به کار میره (برای نمایش روی صفحه/پیش نمایش)
من به زیر تغییرش دادم
public string HandlerPath = HttpContext.Current.Server.MapPath("~/files/");
اگر از صفحات webform که از masterpage تبعیت می کنند، استفاده می کنید باید در رویداد page_load صفحه کد زیر را وارد کنید
this.Form.Action = "JQueryFileUploader/FileTransferHandler.ashx";
JQueryFileUploader در بالا پوشه حاوی فایل های اپلودر است که handler درون ان می باشد.
به این دلیل که masterPage به طور اتوماتیک محتویات contentPlaceHolder را در یک from قرار میدهد
<form name="aspnetForm" method="post" action="default.aspx" id="aspnetForm">
و form که درون اون تعریف کردیم را نادیده می گیرد(کد صفحه html)
<div id="fileupload">
<form action="JQueryFileUploader3/FileTransferHandler.ashx" method="post" enctype="multipart/form-data">
[تمامی نوشته های بالا مربوط میشه به فایلjQueryFileUpload.Net-master]
+فایل ضمیمه example Asp.NetjQueryFileUpload by shh by preiView قابلیت پیشنمایش عکس داره و فقط از فایل handler.ashx استفاده می کند.
دمو (http://blueimp.github.com/jQuery-File-Upload/)
در این قسمت اگه وقت کنم اموزش می گذارم.
Features
Multiple file upload:
Allows to select multiple files at once and upload them simultaneously.
Drag & Drop support:
Allows to upload files by dragging them from your desktop or filemanager and dropping them on your browser window.
Upload progress bar:
Shows a progress bar indicating the upload progress for individual files and for all uploads combined.
Cancelable uploads:
Individual file uploads can be canceled to stop the upload progress.
Resumable uploads:
Aborted uploads can be resumed with browsers supporting the Blob API.
Chunked uploads:
Large files can be uploaded in smaller chunks with browsers supporting the Blob API.
Client-side image resizing:
Images can be automatically resized on client-side with browsers supporting the required JS APIs.
Preview images:
A preview of image files can be displayed before uploading with browsers supporting the required JS APIs.
No browser plugins (e.g. Adobe Flash) required:
The implementation is based on open standards like HTML5 and JavaScript and requires no additional browser plugins.
Graceful fallback for legacy browsers:
Uploads files via XMLHttpRequests if supported and uses iframes as fallback for legacy browsers.
HTML file upload form fallback:
Shows a standard HTML file upload form if JavaScript is disabled.
Cross-site file uploads:
Supports uploading files to a different domain with Cross-site XMLHttpRequests.
Multiple plugin instances:
Allows to use multiple plugin instances on the same webpage.
Customizable and extensible:
Provides an API to set individual options and define callBack methods for various upload events.
Multipart and file contents stream uploads:
Files can be uploaded as standard "multipart/form-data" or file contents stream (HTTP PUT file upload).
Compatible with any server-side application platform:
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.
منبع:
https://github.com/maxpavlov/jQuery-File-Upload.MVC3/downloads
https://github.com/i-e-b/jQueryFileUpload.Net/downloads
------------------------------------------------------------------------------------------
نحوه استفاده:
باید در 4 .net باشه
من پوشه ای ب نام jqueryFileUpload در app-code ساختم و فایل های ashx.cs را درونش کپی کردم و در
<%@ WebHandler Language="C#" CodeBehind="jqueryFileUpload/FileTransferHandler.ashx.cs" Class="jQueryUploadTest.FileTransferHandler" %>
codeBehine را تغییر دادم
مسیر StorageRoot در فایل FileTransferHandler.ashx.cs برای ذخیره کردن فایلها مورد استفاده قرار میگیره
public string StorageRoot
{
get
{
//writed by hamed.hossani@gmail.com
return HttpContext.Current.Server.MapPath("~/files/");
// ConfigurationManager.AppSettings["StorageRoot"];
}
}
مسیر HandlerPath در FilesStatus.ashx.cs برای بارگزاری اطلاعات به کار میره (برای نمایش روی صفحه/پیش نمایش)
من به زیر تغییرش دادم
public string HandlerPath = HttpContext.Current.Server.MapPath("~/files/");
اگر از صفحات webform که از masterpage تبعیت می کنند، استفاده می کنید باید در رویداد page_load صفحه کد زیر را وارد کنید
this.Form.Action = "JQueryFileUploader/FileTransferHandler.ashx";
JQueryFileUploader در بالا پوشه حاوی فایل های اپلودر است که handler درون ان می باشد.
به این دلیل که masterPage به طور اتوماتیک محتویات contentPlaceHolder را در یک from قرار میدهد
<form name="aspnetForm" method="post" action="default.aspx" id="aspnetForm">
و form که درون اون تعریف کردیم را نادیده می گیرد(کد صفحه html)
<div id="fileupload">
<form action="JQueryFileUploader3/FileTransferHandler.ashx" method="post" enctype="multipart/form-data">
[تمامی نوشته های بالا مربوط میشه به فایلjQueryFileUpload.Net-master]
+فایل ضمیمه example Asp.NetjQueryFileUpload by shh by preiView قابلیت پیشنمایش عکس داره و فقط از فایل handler.ashx استفاده می کند.