Jump to content

[solved]need To Upload A Single File To Server Folder


shobhitjain
 Share

Recommended Posts

You cannot automatically upload files from a client's filesystem - the user has to deliberately select that file.

Link to comment
Share on other sites

Well i have found out the solution.here it is :i just need to change getElementByTagNameand typed there the fixed URL.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title></title><meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta http-equiv="imagetoolbar" content="false"><meta http-equiv="imagetoolbar" content="no"><script type="text/javascript" src="uploader.js"></script><script type="text/javascript">window.addEventListener("load", function() { // handle image preview var input = document.getElementById("photo"); // handle file upload var form = document.getElementsByTagName("form")[0]; var uploader = new Uploader(form); var uploadBtn = document.getElementById("upload"); uploadBtn.addEventListener("click", function() { uploader.send(); }, false);}, false);</script></head><body><form action="upload.php" method="post" enctype="multipart/form-data" onsubmit="return false;"> <fieldset> <input type="file" name="photo" id="photo"> <input type="submit" value="Upload" id="upload"> </fieldset></form></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...