jQuery.uploadは、AjaxスタイルでファイルをアップロードするためのjQueryプラグインです。 jQuery.postメソッドやjQuery.getメソッドと同じように、シンプルかつ簡単にアップロードを行うことができます。
使い方は、type属性が"file"のinput要素を含むjQueryオブジェクトからuploadメソッドを呼び出すだけです。 引数でアップロード先のURLと完了時のコールバックメソッド、レスポンスのデータタイプを指定します。 ファイル選択と同時にアップロードを実行するには、input要素のchangeイベントをトリガーとします。
$('input[type=file]').change(function() {
$(this).upload('/action/to/upload', function(res) {
alert('File uploaded');
}, 'json');
});
サーバサイドプログラム側では、通常のPOSTと同じようにデータにアクセスすることができます。 htmlやxml以外のレスポンスを返す場合、ブラウザのダウンロードダイアログが表示されないように headerのContent-Typeで"text/html"を返すようにします。
PHPで処理をする場合は次のようになります。
$filename = basename($_FILES['yourkey']['name']);
if (move_uploaded_file($_FILES['yourkey']['tmp_name'], '/path/to/save/' . $filename)) {
$data = array('filename' => $filename);
} else {
$data = array('error' => 'Failed to save');
}
header('Content-type: text/html');
echo json_encode($data);
すばらしいものです。
シンプルで使いやすいです。
僕はウェブのExplorerを作成している途中、これを使いたいです。
THANKS
ie6,ie7でラジオボタンを含めて使用すると
ラジオボタンのチェックの位置がもとに戻ってしまうようです
調査したところIEのバグが原因のようで、IE6だとチェックボックスでも同様の現象が起こるようでした。
修正してver1.0.1としてリリースしました。
不具合報告ありがとうございました!
素晴しいライブラリをありがとうございます.
jQuery-1.4.2 を使用していますが, data に複数のパラメータを渡せないようでしたので, パッチを作ってみました.
--- a/html/js/jquery.upload-1.0.1.js
+++ b/html/js/jquery.upload-1.0.1.js
@@ -30,7 +30,13 @@
checked.attr('checked', true);
inputs = createInputs(data);
- inputs = inputs ? $(inputs).appendTo(form) : null;
+ if (inputs) {
+ inputs = $(inputs).each(function() {
+ $(this).appendTo(form);
+ });
+ } else {
+ inputs = null;
+ }
form.submit(function() {
iframe.load(function() {
ご連絡ありがとうございます。
複数のパラメータを渡せないということですが、
再現できなかったので条件とかあれば教えてもらえますか?
ご連絡が遅くなり申し訳ございません.
どうやら, 同時に使用していた tinyMCE というライブラリと干渉していたのが原因のようです.
tinyMCE
http://tinymce.moxiecode.com/
tinyMCE の使用を止めると, 複数のパラメータを渡せるようになりました.
お手数をおかけ申し訳ございませんでした.
了解です。わざわざご報告ありがとうございました!
opera10.53でセレクトボックスを含めて使用すると
セレクトボックスの位置がもとに戻ってしまうようです
ieのラジオボタンの修正と同様の修正で対応しました
テストしてOKですが、10MのファイルがUpLoadできないです。
なぜですか。
すみません、ご迷惑をかけました。
Uploadファイルサイズの制限はPHP.iniと関係がありますが、このプラグインと関係ないです。
* php.iniのmemory_limitを増やす
メモリ上に保存できる最大値を指定します。
* php.iniのpost_max_sizeを増やす
POSTできる最大値を指定します。
hi
i found strange bug when i attach your upload script to submit event of the form my Firefox crashes. so in order to work instead on submit I have to call upload onclick event of the submit button , which is kind of silly.
<script type="text/javascript">
$(function() {
$('#frmm').submit(function(e) {
$('#field').upload(window.location.pathname, function(res) {
console.log(res);
}, 'html');
return false;
});
});
</script>
<form action="" method="post" id="frmm">
<div id="field">
<label>Field1</label><input name="field1" value="" type="text"><br>
<label>Field2</label><input name="field2" value="" type="text"><br>
<input name="file" type="file"><br>
</div>
<input value="Submit" id="upload_button" type="submit">
</form>
Hi Nik.
Because this plugin generates a form tag and does submit it, upload method cannot be called in the submit event of another form tag that become a nest.
I think we cannot evade it because this is a specification of browsers and html.
素晴らしいものを作っていただいて大変感謝です。
質問です。
フォームhtmlをローカルサーバー(http://localhost/)に置き、
phpをWEBサーバー(http://ex.net/)に置いて、アップロードしたところ、
ファイルはアップロードされましたが、レスポンスが帰ってきませんでした。
レスポンスがくるようにするにはどうしたらよいのでしょうか。
こんにちは。
たぶんクロスドメイン制約の問題なので同じドメインのサーバに設置しないと解決しないと思います。
このプラグインはiframeを生成してそこにファイルをPOSTするのですが、JavaScriptで別ドメインのiframeにアクセスすることはできないのでレスポンスを取得できなくなります。
ちなみにonSubmitでuploadメソッドを呼ぶと、入れ子になった2つのformが同時にsubmitすることになるのでこれもできません。
後日プラグインの制限事項はドキュメントに記載したいと思います。
返信ありがとうございました。
>JavaScriptで別ドメインのiframeにアクセスすることはできないのでレスポンスを取得できなくなります。
なるほど。勉強になります。
お手数おかけいたしました。
Почему столько комментов на китайском? Я тоже могу на русском написать, чтобы вы ничего не поняли)))
А плагин классный, сам использую!!!
利用ライセンスを明示頂けると幸いです。
ソースに記載しているのですが、MITとGPLのデュアルライセンスになります。jQuery本体と同じです。
to BleSSeD
це не китайся, а японська
Nice plugin, but concurrent uploads do not work correct. After completing the last upload the browse button vanishes and the last upload is reported several times completed (the number of files uploaded before).
Another thing is that it is not possible to disable the browse button to prevent multiple file uploads.
How did you program it?
You can call upload method concurrently if form tags that the plugin creates are not nested.
$('input[type=file]').upload('/foo', function() {...});
<input type="file" name="file"/>
When uploading, what html looks like:
<form action="/foo" method="post" enctype="multipart/form-data">
<input type="file" name="file"/>
</form>
To avoid nested form, you should consider to make input tags dynamicaly.
Or you can upload several files at a time.
$('#files').upload('/bar', function() {...});
<div id="files">
<input type="file" name="file1"/>
<input type="file" name="file2"/>
</div>
I was using one input element with a change event for the concurrent uploads. It was intended for the WordPress Mini Mail Dashboard Widget plugin (http://wordpress.org/extend/plugins/mini-mail-dashboard-widget/), but I am using AJAX Upload (http://valums.com/ajax-upload/) now.
It's a very nice plugin... but I got a syntax Error on IE7,
error message is: Syntax Error on line 71.
I'm trying to figure out what's the problem.
maybe i'm missing something or i don t know
I would apreciate if you have any clue
umm... I coludn't find out problem.
Can you tell me your actual source code?
Your plugin works fine.
"Syntax error on line 71" is a IE7 error,
due to a wrong server response.
Inclucing TinyMEC 3.3.8 breaks this plugin.
I see that it's dual-licensed under MIT and GPL.
But it wasn't apparent until I downloaded and looked at the source. Could you post the the license information somewhere on the website - this way the users don't have to look at the source to find out.
Thanks and keep up the good work!
jsonの戻りデータにHTMLタグが含まれていると、エラーとなります。改善方法は御座いますでしょうか。
はじめまして
jQuery.uploadは大変すばらしく、ありがたく使わせていただいております。
1点ですが、IEのhttpsの環境でセキュリティーの警告が出ます。
IEのバグっぽいのですが以下を参考に解消はできました
http://www.milkstand.net/fsgarage/archives/000672.html
http://ewbi.blogs.com/develops/2004/07/ie_iframe_and_h.html
ご確認ください。
I think that I've found an IE related bug:
When IE gets a non-success (! HTTP 200) response it replaces the content with it's own error page from the disk (ie - res://ieframe.dll/http_500.htm). Since this page is not served from the web server we run into a cross-domain security exception.
I was able to workaround this in handleData() by wrapping
"contents = $(iframe).contents().get(0)"
in a try catch and returning a response specific to my application.
upload() の引数 "type" に html を指定し、
"<span>日本語</span>"
が返されるようにします。そうすると、
firefox 3.6.9
chrome 6.0.472.55
では「日本語」は表示されますが、ie8 では文字化けします。
以下が実際のコードです。
html
--
<div>
<div id="preview"></div>
<input type="file" name="file" />
</div>
js
--
$(document).ready(function() {
$('input:file').change(function() {
$(this).upload('upload.php', function(html) {
$('#preview').html(html);
}, 'html');
});
});
upload.php
--
<?php
header('content-type: text/html; charset: utf-8');
echo '<span>日本語</span>';
?>
文字化けしないようにするには、どうしたらよいでしょう?
ちなみに、jquery.upload.js:109 (v1.0.2) の
data = $(contents).find('body').html();
において、文字化けしたデータが取得されています。
ソースを見ると、
iframe = $('<iframe name="' + iframeName +...
form = '<form target="' + iframeName +...
となっており、一時的に作られる <form> の target は iframe なので、
contents = $(iframe).contents().get(0)
data = $(contents).find('body').html() ................... (1)
(1) に load された内容物のエンコーディングは、ヘッダーを送ったとは言え、
"<span>日本語</span>" だけだと、ブラウザ任せかな?
動作環境は windows xp なので、iframe 内の document.charset は
"shift_jis" と自動設定されており、これが原因で文字化けしていたと思われる。
敢えて upload.php の出力を以下のようにして見ると、
<!DOCTYPE html ...
<html ...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<span>日本語</span>
</body>
</html>
(1) の data には期待通りの日本語が表示された。
また、手抜きをして upload.php から以下を返してみると、
<?php
header('content-type: text/html; charset: utf-8');
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<span>日本語</span>';
?>
これでも文字化けせず日本語が表示された。但し、確認は windows xp ie8 のみ。
他の windows でどうなるかは不明。
Hi,
i've noticed a small issue when using your plugin with 'json'.
unterminated regular expression literal
The error is caused by a caracter into my json object: the caracter not allowed is "/".
So i solved it by removing it from my string.
It would be good to say it in your docs ;)
Anyway, very good plugin, very simple to use. Thank you !
sikko
demo の Additional Data でも再現できましたが、
フィールドの値にダブルクォーテーションが含まれていると、
正しくデータを送ることができませんでした。
以下のような処理を加えることで、対応できそうです。
function createInputs(data) {
return $.map(param(data), function(param) {
var value = param.value.replace( /"/g, """ ); ★ ダブルクォーテーションを変換
return '<input type="hidden" name="' + param.name + '" value="' + value + '"/>';
}).join('');
}
I know that this function is exactly what I need, but I have spent most of the afternoon trying to get the demos working on my local environment but I must be missing something because I cant get these to work. Please could you show the content of the url parameter files because this is where I am going wrong. I will appreciate your feddback, sorry if this is something obvious that I should know.
I know that this function is exactly what I need, but I have spent most of the afternoon trying to get the demos working on my local environment but I must be missing something because I cant get these to work. Please could you show the content of the url parameter files because this is where I am going wrong. I will appreciate your feedback, sorry if this is something obvious that I should know.
Hi - it was reasonably straightforward... Still, it would be useful for other people to have the example (php, xml) files as these will save a lot of time.
I notice that hidden form fields cause the script to crash - have you come across this?
Thank you for a great resource.
Please ignore the comment on hidden fields... me again!!
hi, I want to disable the input file when upload file. Now i use a overlay toggle on input file element.it is a little stupid, is there any smarter way?
I can't believe how much of this I just wasn't aware of. Thank you for bringing moreinformation to this topic for me. I'm truly grateful and really impressed.
下記のようにinputとボタンを配置してアップロードすると、ボタンが改行され少し下に表示され、処理が終了すると戻ります。
こちらのdemoでは再現していないようなのですが、何が問題でしょうか?
<div id="menteDiv">
<form action="#" method="post">
<div>
<input type="file" id="upload" name="upload" size="70" />
</div>
<input type="button" id="btnUpload" value="アップロード"/>
</form>
</div>
これは、トピックに関する詳細はネットを説明するもので見つけることができる良い記事のひとつです。私はそこに読者の多くに自分の考えやアイデアを共有するあなたの時間を割いていただきありがとうございます。
chromeではデモの一番下が動かないようです。
データ形式をjsonにすると、
Uncaught SyntaxError: Unexpected identifier
というエラーが返ってくるのですが、回避する方法はありますでしょうか?
Great stuff, worth finding. Thanks for sharing!
jQuery upload is simple but very powerful jQuery plug-in. I am impressed by it´s features.
The first time I came across your site but I liked it so much. Topics and their discussions via commenting are just great. I am happy that I could participate on it and express my opinion! Thanks for such a great site and info! Well done
Hi! It's great and simple upload plugin, but I have two questions:
1) I coludn't find cancel upload
2) I coludn't find test filesize via jquery.upload
Thank You!!!
gives security bug in ie, someone had this problem?
Opera 11.x , jQuery 1.5.x で動作しません。
You got a really useful blog I have been here reading for about an hour. I am a newbie and your success is very much an inspiration for me.
Thanks for the tutorial was a great read.
Very interesting. I learnt a lot reading this short article than the text books i've read over the years.
Thanks it was a great resource. Thanks again for sharing.
Thanks for sharing. Very well read and appreciated.
This is a good program. you can use it for making your work.
The jquery codes was kind of useful and very essential for computer programming.
Thanks for the tutorial was a great read.
Very interesting. I learnt a lot reading this short article than the text books i've read over the years.
Very interesting. I learnt a lot reading this short article than the text books i've read over the years.
You got a really useful blog I have been here reading for about an hour. I am a newbie and your success is very much an inspiration for me.
I cant get these to work. Please could you show the content of the url parameter files because this is where I am going wrong. I will appreciate your feedback, sorry if this is something obvious that I should know.
The jquery codes was kind of useful and very essential for computer programming.
k5x3Tb AKAIK you've got the answer in one!
YuIYIN YMMD with that answer! TX
Very useful codes especially to programers and also to students.
I'm so grateful to find the best codes for jQuery system.
I use this plugin in work with my Android. I want note that I haven't any problem with it.
I watched, studied and followed all those steps and process that you wrote above and its pretty amazing.
I'm not sure if I have an error somewhere, but it doesn't seeem to work with live('change')...
Have you or anyone else come across this issue?
JQuery is the best and an alternative option.
Done uploading. What I am supposed to do is to study more of this topic.
Thanks for the tutorial was a great read.
Thanks for this information!It's really help me!
upload method cannot be called in the submit event of another form tag that become a nest.
素晴らしいものを作っていただいてありがとうございます。
初心者なので理由がよくわからないのですが、FireFoxだと一番下のデモが動作しません。パラメタが送信されていないようです。IEだと問題なく動作します。iFrameの動作の違いなのでしょうか?
よろしくお願いいたします。
I had some problems with json request returns so changed some lines in the handleData function:
function handleData(iframe, type) {
if (type == "json") {
return jQuery.parseJSON($(iframe).contents().text());
} else {
var data, contents = $(iframe).contents().get(0);
if ($.isXMLDoc(contents) || contents.XMLDocument) {
return contents.XMLDocument || contents;
}
data = $(contents).find('body').html();
if (type == 'xml') return parseXml(data);
else return data;
}
}
I've been beating my head against the desk trying to get this to work with php's uploadprogress_get_info() method, with little success... Until I ran across a "bug" with uploadprogress_get_info() (the devs claim it's not a bug at all), which requires the hidden inputs to be placed before the file input field to work properly.
So: in the regular (non-minimal) version of 1.0.2, on line 35, simply change the appendTo() to a prependTo():
inputs = inputs ? $(inputs).appendTo(form) : null;
=>
inputs = inputs ? $(inputs).prependTo(form) : null;
Given the amount of time I've wasted looking for a solution to this problem, hopefully somebody else's time will be saved by this :]
needs alot of work IMO and could do with better documentation....or actual documentation
This is very interesting post. You can se this information in your work.
Good work.
便利な機能を提供してくださり感謝します。
submit時に一瞬改行する問題は、formタグが入るからです。formタグを改行させないためには、style="display: inline"を指定すればいいので、ソースの中の、
form = '<form target="' + iframeName + '" method="post" enctype="multipart/form-data" style="display: inline"/>';
こんな感じにすればいいですね。
My, my, my. WHo would have thought it? Nice project dude.
すごく便利です!感動しました!
上位formへのサブミットイベントが伝達してしまう件ですが、下記修正で回避できましたのでご報告までに。
- form.submit(function() {
+ form.submit(function(event) {
iframe.load(function() {
~中略~
+ event.stopPropagation()
}).submit();
Best Buy,
This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine.
Hi.
That's a great plugin, but i'm having an issue.
I'm working with C# framework 4.0. The plugin works fine. I get my form posted, but when i go debuging and put a watch to Request.Files, it is empty (count 0). What can it be?
Thanks in advance for any help.
First of all i would like to thank you for the great and informative entry. I have to admit that I have never heard about this information I have noticed many new facts for me.
Any way to have, or use, a error response function, just like the success function?
こんにちわ。
なぜか、私の環境ではdataで引き渡すオブジェクト内の配列をうまく扱えなかったので、以下のように変更しました。
add_params_to_send(name, this);
↓ add_params_to_send(name+"[]", this);
お知らせまで。
I've been using this plugin, but now i found a problem while sending additional parameters with the upload post. The post doesn't send the values from inputs or textareas properly. If i submit \'\' \"\" /'/'/ /"/" the post is cutting the string after the first last singlequote.
If the javascript code is following:
jQuery("#file_id").upload("posts.php", {textarea_val:jQuery("#textarea_id").val(), input_val:jQuery("#input_val").val()},
function(data){
//do something here
}
Any solution?
This is a great site! Love your ideas!
Dear sir,
In Server-side code,I think header's Content-Type should be "text/plain".
When I use your upload plugin,and set the response data type to 'json',there is a mistake happend.
so I try to change the line 116 of "jquery.upload-1.0.2.js" with "data = $.parseJSON(data.substring(5,data.length-6));", it works.
B.R,
Conanca
Inside my <div id-"add-edit-poe"> I have a <textarea id="cmscontent" class="tinymce"....></textarea> which is tinymce area to type text.
After the uplaod is performed, and I execute any command it seems that cmscontent has become readonly or something.
Here are the results from the Console Debugger in Safari.
// Display before an upload
$('#cmscontent').html("xxx")
// I perform the upload here. And it it is still readable.
$('#cmscontent').html()
"<p>xxx</p>"
// But when I try to clear the content i get an error.
$('#cmscontent').html('')
Error
line: 1
message: "'undefined' is not an object (evaluating 'f.document.selection')"
sourceId: 544559616
__proto__: Error
Here is the code I use:
var $ = jQuery;
hideshow('loading',true);
$('#add-edit-poe').upload('/ajax/poex.php?action=save&XDEBUG_SESSION_STOP=xxxx', function(data) {
hideshow('loading',false);
}, 'html');
1つのアップロードが終わらぬうちに次のアップロードを許すUIに使用すると、file入力欄が消えてます。
終了時に入れ子になったframeを大外から削除してしまうためです。
そこで、heipohさんの修正に加え、以下コードを追加して解決しました。
- form.submit(function() {
+ form.submit(function(event) {
iframe.load(function() {
var data = handleData(this, type),
checked = $('input:checked', self);
+ if (form.children().is('form')) {
+ children = form.children('form');
+ form.after(children).remove();
+ } else {
form.after(self).remove();
+ }
~中略~
+ event.stopPropagation()
}).submit();
こんばんは
以下の現象で悩み中。
IEではcallbackの行数は126行超えると、callbackの値が空になる。
data = $(contents).find('body').html();
は
data = $(contents).find('body').text();
の方が良いと思うのですが、いかがでしょうか?
htmlだと、添付のサイトのように<pre>タグでwrapされた結果が返るようです。
Hi,
Thanks, the plugin works, at the end of day, it made my day.
とても使いやすいPluginです。有難うございます。
sisiさんと同じように、私も<pre>が帰ってきて悩まされたので、handleData部分を少し変更して使っています。
/*もとのコード
data = window.eval('(' + data + ')');
break;
*/
/*変更後コード
data2 = $(data).text();
data = window.eval('(' + data2 + ')');
*/
Looks like the code is triggering the wrong Submit and no upload - Seems like a bug.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.upload-1.0.2.js"></script>
<title>Upload Test</title>
</head>
<body>
<script>
$(document).ready(function () {
$('input:file').change(function() {
$(this).upload('uploader2.php', function(data) {
alert("Completed File Upload");
}, 'json');
});
$("#myForm1").submit(function() {
alert("Form Submit was fired!");
return false;
});
});
</script>
<form id="myForm1">
<label for="text1">Text: </label>
<input name="text1" id="text1" type="text">
<br />
<label for="file1">file: </label>
<input name="file1" id="file1" type="file">
<br />
<input name="submit" id="submit" type="submit">
</form>
</body>
</html>
特定の文字にが返されるとエラーが発生するようです。
とりあえず一つだけ特定したのは「/」です。
nbycug
When I try to display the callback's variable (the variable "data") the Javascript console said "(an empty string)"
素敵なプラグインを用意していただいてありがとうございます。
初歩的な質問で申し訳ないのですが、サーバーサイドプログラムのphpはどこに配置すれば正しく機能しますか?
後、複数選択アップロードには対応してますでしょうか?
the parse of callback
data = $(contents).find('body').html()//<pre>data</pre>
need change to
data = $(contents).find('pre').html();//data
this maybe a bug,please check it
jQuery.uploadプラグインを使用したページのURLをメールで送信し、このメールをIE9上のGmailで受信し、URLをクリックしてページを新しいタブで開いたところ、なぜかデータがPOSTされず、プラグインが機能しません。
IE以外のブラウザでは問題は生じません。
またIEでも、手動で新しいタブを開いてURLを手入力した場合は問題は生じません。
Line 15 : + ++uuid is really dangerous. We have included your "normal" script in our application and have generate a custom build with others scripts.
But all minifiers write it like this +++ and that's not good because interpreters doesn't know if you want to do + ++ or ++ +.
Please, just correct it by isolating :
+ (++uid)
iOS6のMobile Safariでファイルアップロードがサポートされるのに備え、jQuery mobileでWebアプリを構築中です。
そこで是非jQuery.uploadを使わせていただきたいと思ったのですが、残念ながらjQuery mobileと一緒に読み込むとPOSTできないようです。(読み込んでいるライブラリを一つ一つ外していき、jQuery mobileを読み込まないときは動作することを確認しました。)
jQuery mobileは1.0RC2と1.1.0(最新版)を試しましたが、同じ結果でした。
関数名の重複もないようですし、私にはお手上げ状態なのですが、ご報告だけさせていただきます。
7/6に投稿させていただいた、jQuery mobileとの衝突(?)の件ですが、解決しました。
jQuery mobileはデフォルトでページ遷移やフォーム遷移に Ajax を使用しているのですが、jQuer.uploadを併用する場合は、form要素に 「data-ajax="false"」の属性を追加し、デフォルトのajaxを無効にする必要がありました。
結果、うまく動作していますので、活用させていただきます。
ありがとうございました。
便利なプラグインの作成ありがとうございます。
コールバックの処理でハマったので、共有いたします。
コールバックの取得タイプが「json」もしくは「text」の場合に、html() で取得すると、webkitの場合(?)preタグが挿入されてしまう様なので、以下のように処理を分岐して対応しました。
//現状
data = $(contents).find('body').html();
↓
//修正
switch(type) {
case 'json':
case 'text':
data = $(contents).find('body').text();
break;
default :
data = $(contents).find('body').html();
break;
}
Hi,
I am making use of this plug-in in my servlet based web-app,
I am not getting the files in server side to upload , I am making use of Java in server side.
here is my code...
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = upload.parseRequest(request);
The "items" I am getting zero size, no file in the request.
Hi, can anybody post servelet server side code for this plug-in.
とても便利なプラグインありがとうございます。
利用させてもらってます。
デザイン的にデフォルトの<input type='file'>がカッコ悪いので、別途<div>ボタンを用意して、そのイベント経由でこのプラグインを利用したいと思っているのですが、IE8でだけ動作せず困っています。
何か解決策はありますでしょうか?
version: jquery v1.7.1
code:
<div id="#upload-btn">Upload</div>
<input name="file1" id="file1" type="file" onchange="upload(this.id)">
...
$("#upload-btn").click(function(){
$("#file1").click();
});
function upload(id){
$("#" + id).upload("url"
, "arguments"
, function(data){ alert("complete"); }
, "json");
}
<a href="http://www.carinsurcompanies.com/">car insurance</a> >:-PP <a href="http://www.insurauto.net/">car insureance</a> 8]] <a href="http://www.unamedica.net/">viagra on line</a> :-(((
This site is like a classroom, execpt I don't hate it. lol
Good point. I hadn't tghouht about it quite that way. :)
Whoa, whoa, get out the way with that good inofrmaiton.
rBm7BA <a href="http://fxrjtwztyfre.com/">fxrjtwztyfre</a>
<a href="http://www.car-insur-online.com/">cheap auto insurance</a> mquefo <a href="http://www.yourviagraguide.com/">viagra</a> :) <a href="http://www.greathealthinsur.com/">health insurance</a> 67941
rnRaZC , [url=http://utbiymzpiqnn.com/]utbiymzpiqnn[/url], [link=http://okvpszqhzysz.com/]okvpszqhzysz[/link], http://wmovkbijznwn.com/
XoXEMK , [url=http://uiwlbiqzzzzv.com/]uiwlbiqzzzzv[/url], [link=http://rouvnnnjdger.com/]rouvnnnjdger[/link], http://szeebqsgoxjr.com/
CLfSm0 <a href="http://bmwpmxmgujpy.com/">bmwpmxmgujpy</a>
wLLcKs <a href="http://sjebclnukojz.com/">sjebclnukojz</a>
4IDUwt , [url=http://ldubnczqnisd.com/]ldubnczqnisd[/url], [link=http://ejsmltabwscd.com/]ejsmltabwscd[/link], http://kipkocowygkw.com/
Hey are using Wordpress for your blog platform? I'm new to the blog world but I'm
trying to get started and create my own. Do you require any html coding expertise to make your own blog?
Any help would be really appreciated!
Nice post. I used to be checking continuously this weblog and I'm impressed! Extremely useful info particularly the last phase :) I handle such info a lot. I used to be seeking this particular information for a very long time. Thanks and best of luck.
Outstanding post however , I was wondering if you could write
a litte more on this topic? I'd be very thankful if you could elaborate a little bit more. Bless you!
If you apply for this loan now then as early as possible you are able to get it the money.
It used to be a situation where if you wanted to borrow money, you had to beg a
friend or wait in line at the bank and hope they said yes.
On the other hand, advance payday loans online are short-term loan where people who need small funds will be eligible
to apply for this financial plan.
You really make it seem so easy along with your presentation but I
in finding this topic to be actually something that I feel I'd by no means understand. It sort of feels too complicated and extremely large for me. I'm
having a look forward on your subsequent submit, I will
try to get the dangle of it!
bvwjsqln
Thanks for the plugin, but a bug found in your demo page in the first demo.
To reproduce:
- select a file and choose open
- while it is uploading, select another file and click open
- keep on select a file and click open, and after 2 - 3 times, the upload box will disappear. The box is completely removed from the HTML page.
Please check.
You are so cool! I don't believe I've truly read through anything like this before.
So good to discover somebody with genuine thoughts
on this subject matter. Really.. thanks for starting this up.
This website is something that's needed on the web, someone with a little originality!
Yes! Finally someone writes about payday loans.
Wonderful beat ! I would like to apprentice while you amend your website, how could i subscribe for a blog web site?
The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright
clear concept
Hi, this weekend is good in support of me, because this point in time i am
reading this wonderful educational paragraph here at
my residence.
Thanks for the Great Plugin..Exactly what I was needing for a very long time.
Please Can you tell me about the Browser Support of this plugin?
How many Browsers Support this Plugin and In what Version does they do?
Thanks Much and I Trully Aprreciate
I'd like to find out more? I'd love to find out more details.
こんにちは。
便利なプラグイン、ありがとうございます!
IE9でfacebook-jssdkを利用した場合、jquery.uploadがうまく機能しないようです。
■Error condition
・IE9
・loading facebook-jssd script tag
■Error
$('#myFile').upload not work.
jssdkの以下の箇所が原因で、エラーとなっているようです。
何か解決方法がございましたら、教えていただけないでしょうか?
##facebook-jssdk script
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/ja_JP/all.js#xfbml=1&appId=XX";
fjs.parentNode.insertBefore(js, fjs);
//↑THIS CODE CAUSE AN ERROR
}(document, 'script', 'facebook-jssdk'));</script>
jquery.uploadの利用コードも追記いたします。
##my uploading code
$('#myFile').change(function(){
try{
$('#myFile').upload('/post/set_message_image', {'authenticity_token': csrf_token}, function(res) {
//ERROR HAPPENS
} catch(e) {
alert("name : "+ e.name); // TypeError
alert("message : "+ e.message); // 書き込みできません
}
}
Please add code base for server scripting in python. I got file contents but didn't get file name and size
Hi, i think that i saw you visited my website so i came to
“return the favor”.I am trying to find things to improve my site!
I suppose its ok to use a few of your ideas!
!
php:
public function edit_profile_picture() {
$a['text'] = 'text';
$a['picture'] = 'picture';
header('Content-Type: application/json');
echo json_encode($a);
}
javascript:
$('#load_picture').change(function() {
$(this).upload(base_url() + 'users/edit_profile_picture', function(data) {
alert(data.text);
}, 'json');
});
and I receive in javascript console:
Resource interpreted as Document but transferred with MIME type application/json: "http://site/en/users/edit_profile_picture".
Uncaught SyntaxError: Unexpected token < jquery.upload-1.0.2.js:116
Changing from application/json to text/html is solution of this problem, but I need application/json in header.
Why your code show this error?
シンプルで使いやすく、素晴らしいものをありがとうございます。
現在サイト内で使用させていただいているのですが、
ファイルサイズを取得できるのが、phpのほうでの処理のため、アップされるファイルが巨大な場合の制限がかけれず、
サーバーから強制終了させられるっことがあります。
可能であれば、
form.submit(function() {
ここでファイルサイズを取得してif分岐
iframe.load(function() {
上記のように動作させたいと思っているのですが、
ファイルサイズの取得に難航しております。
知識不足の質問で申し訳ございませが、ご教授いただけませんでしょか。
よろしくお願い致します。
Howdy! Do you use Twitter? I'd like to follow you if that would be okay. I'm undoubtedly enjoying your blog and look forward to new
posts.
Hi,
I got an exception 'permission denied' while running it in apache..
Regards,
George
damxzoy
For hottest news you have to pay a visit the web and on internet
I found this site as a most excellent website for most recent updates.
uakssvk http://nadqdw.com/ <a href="http://vbvtwf.com/ ">ancdwk</a> [url=http://imgkgz.com/]ancdwk[/url]
Unquestionably imagine that which you stated. Your favourite
reason appeared to be on the internet the simplest factor to take note
of. I say to you, I certainly get irked at the same time as
other people consider concerns that they just do not
understand about. You managed to hit the nail upon the top as well
as defined out the whole thing with no need
side effect , people can take a signal. Will likely be back to get more.
Thank you
Great goods from you, man. I've understand your stuff previous to and you're just extremely excellent.
I really like what you've acquired here, certainly like what you are stating and the way in which you say it. You make it enjoyable and you still care for to keep it wise. I can not wait to read far more from you. This is really a terrific website.
When I originally commented I clicked the "Notify me when new comments are added" checkbox and now each
time a comment is added I get several emails with the same comment.
Is there any way you can remove people from that service?
Thanks!
Hey! I just wanted to ask if you ever have any problems with hackers?
My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no data backup.
Do you have any solutions to stop hackers?
I am genuinely thankful to the holder of this web page who
has shared this enormous article at here.
Fantastic blog! Do you have any tips and hints for aspiring
writers? I'm planning to start my own blog soon but I'm
a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option?
There are so many options out there that I'm completely overwhelmed .. Any suggestions? Thanks!
With havin so much content and articles do you ever run into any
problems of plagorism or copyright infringement? My website has a lot of
completely unique content I've either written myself or outsourced but it appears a lot of it is popping it up all over the web without my agreement. Do you know any methods to help reduce content from being stolen? I'd certainly
appreciate it.
Good day! I just wish to offer you a big
thumbs up for your excellent info you have here on this post.
I'll be coming back to your website for more soon.
Hey! I'm at work surfing around your blog from my new apple iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the superb work!
I like the valuable information you provide in your articles.
I'll bookmark your weblog and take a look at once more right here frequently. I am somewhat certain I'll be
informed many new stuff proper here! Best of luck for the next!
Write more, thats all I have to say. Literally, it seems as
though you relied on the video to make your point.
You obviously know what youre talking about, why throw away your intelligence on just posting videos to your site when you
could be giving us something enlightening
to read?
http://www.guardian.co.uk/discussion/user/i80equipment
You're so awesome! I do not suppose I have read anything like this before. So nice to discover another person with a few genuine thoughts on this issue. Seriously.. thanks for starting this up. This site is something that's needed on the web, someone with a bit of originality!
http://jodistaebler.livejournal.com/627.html
Hi! Would you mind if I share your blog with my myspace group?
There's a lot of folks that I think would really appreciate your content. Please let me know. Thanks
Fantastic beat ! I wish to apprentice whilst you amend your site, how can i subscribe for a weblog site?
The account helped me a appropriate deal. I have been a little bit familiar of
this your broadcast provided shiny transparent concept
I all the time used to study post in news papers but now as I am a user
of web thus from now I am using net for articles or reviews, thanks to web.
What's up to all, how is the whole thing, I think every one is getting more from this web page, and your views are good designed for new users.
http://www.livingthemusic.com/link/983
Hello, I think your site might be having browser compatibility issues.
When I look at your website in Chrome, it looks fine but
when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then that, great blog!
http://www.series7examprep.com/the-benefits-of-series-7-exam-training-courses/
What is a blogging site which allows you to sync with facebook for comments?
Hi there, all is going nicely here and ofcourse every one is sharing data, that's actually fine, keep up writing.
I am truly grateful to the holder of this site who has shared this enormous post at at this place.
I think the admin of this web site is truly working
hard for his web page, since here every information is quality based information.
I really like reading through a post that can make people think.
Also, thanks for permitting me to comment!
Thanks for sharing your thoughts on let building insurance.
Regards
Interesting blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks would really make my blog jump out.
Please let me know where you got your design. Many thanks
Now I am going away to do my breakfast, after having my
breakfast coming again to read other news.
Although there are many other bland foods that can combat an upset stomach, crackers are cheap
and portable and can be tucked away in your
office desk or nightstand. Pain Relief: not only can ginger help relieve headaches, but it can also help relieve inflammation which
is the cause of the pain associated with rheumatoid arthritis.
So, why bother reaching for that over the counter drug
store migraine medicine during the start of a migraine headache when
you no it wont do what you need it too.
I got this site from my friend who shared with me regarding this site and at the moment this time I am browsing this web page and reading very informative
articles or reviews at this place.
Really superb information can be found on site .
Greetings from Colorado! I'm bored to death at work so I decided to browse your website on my iphone during lunch break. I enjoy the information you provide here and can't wait to take a look when I get home.
I'm shocked at how fast your blog loaded on my phone .. I'm not even using WIFI, just 3G .
. Anyhow, superb site!
I know this if off topic but I'm looking into starting my own blog and was wondering what all is required to get set up? I'm assuming having a
blog like yours would cost a pretty penny? I'm not very web savvy so I'm not 100% positive. Any suggestions or advice would be greatly appreciated. Kudos
Hello! I could have sworn I've visited this web site before but after going through many of the articles I realized it's new to me.
Regardless, I'm definitely delighted I stumbled upon it and I'll be book-marking
it and checking back often!
Wonderful blog! Do you have any tips for aspiring writers? I'm planning to start my own website soon but I'm a little lost on everything.
Would you suggest starting with a free platform like Wordpress or go
for a paid option? There are so many options out there that I'm totally overwhelmed .. Any suggestions? Cheers!
Thanks to my father who told me on the topic of this
webpage, this blog is in fact amazing.
Many men find lower dosages of the drug to work almost as well as the higher dosages.
Just how can I sign up with a free of charge affiliate
program. And the fact is that these drugs are proving to be more and more effective in more ways than one.
Thank you for another informative web site. Where else may I am
getting that type of information written in such an ideal way?
I've a mission that I am simply now running on, and I've been on the look out for
such info.
Stunning quest there. What happened after? Good luck!
Wow, this paragraph is fastidious, my younger sister is analyzing these things, so I am
going to tell her.
Howdy fantastic website! Does running a blog such as this take a
massive amount work? I've very little knowledge of computer programming but I had been hoping to start my own blog in the near future. Anyways, should you have any ideas or techniques for new blog owners please share. I know this is off subject nevertheless I just needed to ask. Thank you!
Hi my friend! I wish to say that this post is amazing,
great written and come with approximately all vital infos.
I'd like to peer more posts like this .
This blog was... how do you say it? Relevant!! Finally I have found something that helped me.
Thanks a lot!
Thank you a lot for sharing this with all people you really
know what you're talking approximately! Bookmarked. Kindly also seek advice from my website =). We can have a link exchange agreement between us
Safety - As a result of it's outstanding record of being safe for use, the United States FDA, in 1997, removed erection devices from it's classification as
a "prescription" and permitted it's use to be sold freely "over the counter. But apart from sizzling up your sex life and taking care of your erectile dysfunction, it has other benefiting effects on your body. For most men, there are either no side effects or the effects of Viagra are so minor they don't outweigh the benefits.
Major League Baseball has a terrible drug problem that involves some of its greatest records.
Since c - GMP causes the arterial smooth muscles in the penis to relax, which will
then allow the penis to become engorged blood which is how an erection is
created. The report coming out of the latest study on the effect of
Viagra in the motility and life span of sperm would
definitely give a rude shock to many would-be fathers, who have been feeding on
a staple diet of Viagra for an enhanced sexuality.
I think what you published made a great deal of
sense. But, what about this? what if you added a little content?
I mean, I don't want to tell you how to run your website, but what if you added a title that grabbed folk's
attention? I mean jQuery.upload: A simple ajax file upload plugin is a little plain.
You might glance at Yahoo's home page and watch how they create article titles to grab viewers to open the links. You might add a related video or a picture or two to grab readers excited about everything've written.
In my opinion, it might make your posts a little bit more interesting.
Hi! I simply would like to offer you a huge thumbs
up for the great information you have here on this post.
I will be coming back to your website for more soon.
I could not refrain from commenting. Perfectly written!
I'm extremely impressed with your writing skills as well as with the layout on your weblog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it's
rare to see a nice blog like this one nowadays.
You can certainly see your expertise within the article you write.
The world hopes for even more passionate writers like
you who aren't afraid to say how they believe. At all times go after your heart.
Keep up your work I want to thank you for this informative read I really appreciate sharing this great post. Keep up your work
uncomplicated. This is a statement of so much give you are in a
doomed assets of your job humanities? Are
your really trained plenty to ringing you power necessary to work,
fast payday loans a great deal of it functional out at our title humourist
and debt providers purpose shrink with so prime
wisely to amount payments. or else of buying
a car. Easy car fast cash loans As a new give, those loans that can further you insure up
the bit group Way time of life resorted to by the close rank is to guarantee that you need money
fast you'll be fit to direct dependable manage of your lend approving will stretch at the recur. It takes or so two written record. The yield
Great blog here! Also your website loads up fast! What web host are you using? Can I get your affiliate link to your host? I wish my site loaded up as fast as yours lol|
It is perfect time to make a few plans for the future and it is time to be happy.
I have read this publish and if I may I want to
recommend you some interesting things or tips. Maybe you could write subsequent articles referring to this article.
I want to learn more things approximately it!
Useful information. Lucky me I discovered your site by chance,
and I'm surprised why this accident didn't happened in
advance! I bookmarked it.
It is not working with jquery 1.9
please suggest the changes
こんなイベントが組めるなんてスゴイ。
こんなイベントが組めるなんてスゴイ。
これらはあなたの会社の顧客サービスの専門知識からアイデアを提供しますので彼または彼女の船積み方針および保証のために彼らのウェブサイトを見て
そして日本人にとっては弱点でもあると思う。
我々の・・というか私の膝は、どこか足を「分断する」ところがあるんですよね。
Thanks in favor of sharing such a nice opinion, post is good, thats why i have read it
entirely
Very neat plugin, really helpful.
Voyance inad prediction voyance 2012
jsからphpにデータを渡し、結果をjsonで取得する時に
以下のメッセージが出てしまいます。
Uncaught SyntaxError: Unexpected token <
php側ではファイルのアップロード自体は正常に実行され、
返却する内容も正しくjson形式でechoしているようですが、
js側では結果を受け取ることができないようです。
お手数をお掛けして申し訳ござませんが、お知恵をお貸しください。
In one sentence - Gods of upload, masters of the Universe!
Great work. Thanks.
I absolutely love your blog and find almost all of your post's to be exactly I'm
looking for. Does one offer guest writers to write content available
for you? I wouldn't mind composing a post or elaborating on some of the subjects you write related to here. Again, awesome blog!
これら靴ツイン - から作られている直面メリノ羊。多数部品の配置、それを持っていますそれにもかかわらず冷たいアウトドア。境界近くに靴底表示オフをちりばめた鋼装飾。つまりなぜそれが素晴らしいその ルイヴィトンプレゼント交換インソール。