<div class="grid--cell fl1 lh-lg">
<div class="grid--cell fl1 lh-lg">
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, <a href="/help/reopen-questions">visit the help center</a>.
</div>
</div>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2013-03-04 12:44:04Z" class="relativetime">7 years ago</span>.</div>
</div>
</aside>
I need an asynchronous file uploader. No, i am not looking for a plugin. I am just looking for a simple jquery+AJAX uploader that will upload the file asynchronously. I have checked Google but haven't found anything useful.
Here is my html:
<form method="post" enctype="multipart/form-data" ">
File Name:<input type="text" name="name"/> <br/><br/>
Browse: <input type="file" name="file"/> <br/><br/>
<input type="submit" id='button' Value="Upload the video file" name="submit"/>
</form>
my php code:
<?php
if(isset($_POST["submit"]))
{
$filename=$_POST["name"];
$ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
$size=$_FILES["file"]["size"];
$size=$size/1000000;
$size=round($size, 2);
$size.="MB";
$namewithext=$filename." (".$size.")".".".$ext;
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
}
else
{
if (file_exists("file/" . $_FILES["file"]["name"]))
{
echo "<script> alert('".$_FILES["file"]["name"] . " already exists. "."');</script>";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"file/" . $namewithext);
echo "<script> alert('"."success"."');</script>";
}
}
}
else
{
}
?>
I have no experience with jquery. Thanks so much!
</div>
It is inevitable that you will have to use a "plugin" to your definition, but...
Here's the good news:
There's a really good, easy to use, simple to code jQuery-File-Upload by blueimp that you can Download Here.
You wanted it simple:
Since you are looking for it to be a simple, basic jQuery... You can Look Here for a basic tutorial on what you're looking for.
Side note:
It isn't so much a site plug-in as a javascript library to do what you want to for a "Basic File jQuery uploader.
Other option:
Your only other option without uploading javascript libraries would be to use an iFrame that you post the uploaded iFrame to, which can simulate jQuery, in the way that you don't have to reload the page for it to upload the file.