Responsive Ad
Responsive Ad

Pinned Post

Featured Games
Cookie Consent

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.

404Something Wrong!

The page you've requested can't be found. Why don't you browse around?

Take me back
Featured Apps

APMODY

Mauris lacus dolor, ultricies vel sodales ac, egestas vel eros.

webpaylaşım

Situs Coder Blogging yang menyediakan tutorial seputar Blog, Coding, dan Editing. Belajar Fundamental Programming disinlah tempatnya!

Code Pelajar

Fundamental Programming.

See All

ajax dosya yüklemek html kaynak kodu

Gmail tarzı ajax dosyalarını yüklemek için düzenleme gerektirmeyen test edilmiş hazır bir upload açık kaynak kodu. Yapmanız gereken tek şey hangi tür dosyaların yükleneceğini belirleyen bir form oluşturma.

index.html için kaynak kod örneği

<script src="/webtoolkit.aim.js" type="text/javascript"><!--mce:0--></script>       <script type="text/javascript"><!--mce:1--></script>
<form action="/index.html" method="post">
    <div><label>Name:</label>   <input name="form[name]" type="text" /></div>
    <div><label>File:</label>   <input name="form[file]" type="file" /></div>
    <div><input type="submit" value="SUBMIT" /></div>
</form>
<hr />
<div># of submited forms: <span id="nr">0</span></div>
<div>last submit response (generated by form action - index.php file):</div>
.js kaynak kod örneği
/**
*
* ajax dosya yüklemek
* http://www.webilgici.blogspot.com/
*
**/
AIM = {
frame : function(c) {
var n = 'f' + Math.floor(Math.random() * 99999);
var d = document.createElement('DIV');
d.innerHTML = '';
document.body.appendChild(d);
var i = document.getElementById(n);
if (c &amp;&amp; typeof(c.onComplete) == 'function') {
i.onComplete = c.onComplete;
}
return n;
},
form : function(f, name) {
f.setAttribute('target', name);
},
submit : function(f, c) {
AIM.form(f, AIM.frame(c));
if (c &amp;&amp; typeof(c.onStart) == 'function') {
return c.onStart();
} else {
return true;
}
},
loaded : function(id) {
var i = document.getElementById(id);
if (i.contentDocument) {
var d = i.contentDocument;
} else if (i.contentWindow) {
var d = i.contentWindow.document;
} else {
var d = window.frames[id].document;
}
if (d.location.href == "about:blank") {
return;
}
if (typeof(i.onComplete) == 'function') {
i.onComplete(d.body.innerHTML);
}
}
}

ve son olarak php kaynak kodu

print_r($_REQUEST['form']); değişiklikler yapabilir kendinize göre ayarlayabilirsiniz..