2006-06-16, 02:55 PM
I'm making an inline upload script using ajax and iframe.
I've made the ajax script and everything is done, although I got an problem since It runs the ajax script before the upload is done, and therefore the file that you just uploaded won't appear.
I've got this code here now.
So it passes the uploading file to the iframe and what it should do is it should show the files in the items id.
The ajax returns this.
But the problem is as said that it runs before the file is uploaded, any ideas?
I know I could give it an timeout but.. I wouldn't know if the page was done loading or not :/
I've made the ajax script and everything is done, although I got an problem since It runs the ajax script before the upload is done, and therefore the file that you just uploaded won't appear.
I've got this code here now.
<form enctype="multipart/form-data" method="post" action="admin.php?p=inline-upload" onsubmit="quickupload('admin.php?p=inline-upload');" target="iframe">
<fieldset class="adminfield">
<legend> Last opp fil </legend>
<div style="margin-bottom: 10px">
<input type="file" name="file" size="50" />
<input type="hidden" name="url" value="$url" />
<input type="submit" name="submit" value="Last opp fil" class="submit" />
</div>
<div id="loading" style="display: none;"></div>
<div id="items">$files</div>
<iframe name="iframe" src="admin.php?p=inline-upload" style="display:none;height:0;width:0"> </iframe>
</fieldset>
</form>
You can see the jscript over HereSo it passes the uploading file to the iframe and what it should do is it should show the files in the items id.
The ajax returns this.
echo show_files();
which is an list over all files in an folder.But the problem is as said that it runs before the file is uploaded, any ideas?
I know I could give it an timeout but.. I wouldn't know if the page was done loading or not :/