と幅と高さを検証します。ここ
)がasp.net
<script type="text/javascript">
// <![CDATA[
var id = "55";
var theString = "asdf";
$(document).ready(function() {
$('#fileInput').uploadify({
'uploader': 'uploadify/uploadify.swf',
'script': 'Upload.ashx',
'scriptData': { 'id': id, 'foo': theString},
'cancelImg': 'uploadify/cancel.png',
'auto': true,
'multi': true,
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.png;*.gif;*.bmp;*.jpeg',
'queueSizeLimit': 90,
'sizeLimit': 4000000,
'buttonText': 'Choose Images',
'folder': '/uploads',
'onAllComplete': function(event, queueID, fileObj, response, data) {
}
});
}の私が持っているサンプルコードです。
その後、あなたはハンドラ(.ashx)を作りたい:へ - アップロードされた画像の幅と高さを検証し
public class Upload : IHttpHandler, IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
try
{
HttpPostedFile file= context.Request.Files["Filedata"];
int id = (Int32.Parse(context.Request["id"]));
string foo = context.Request["foo"];
file.SaveAs("C:\\" + id.ToString() + foo + file.FileName);
context.Response.Write("1");
}
catch(Exception ex)
{
context.Response.Write("0");
}
}
}
質問はどこですか? – V4Vendetta
クライアント側でアップロードされた画像の高さと幅を確認することはできません。いくつかのjQueryプラグインがあるかもしれませんが、それらをグーグルで試してみてください。しかし、このプラグインは非常に重いです。ページサイズの問題を避けるために、サーバー側でイメージの高さと幅を検証する必要があります。もしあなたがコードを取得することをお勧めします。 – Murtaza
あなたは必要なものを簡単な英語で説明できますか??? ??? – Murtaza