i need to upload files to the server without the page being reloaded. once the file has been upload the user needs to be notified that it has been uploaded.
i need the image to be assigned to a variable name and then stored on the server for use on other pages. this is the code i have used to send the image to the upload page
the code for my submit button is
should this be working or have i gone wrong somewhere along the line.
can the Ext.Ajax.request be used as a stand alone or do i need the ext.lib to use it. Site stolen with Javascript, help needed:: 2 posts - Last post: Oct 19, 2004Hello, everybody. A client of mine has a problem with some guy that has taken all his site and translated it to Chinese, getting all the http://www.webmaster-talk.com/coding-forum/17072-site-stolen-with-javascript-help-needed.htmlHOME | Freelance Project! Part Time Job! Permanent Job! | Expert PHP and :: Expert PHP and Javascript help needed to troubleshoot format and validation on form by I need someone who is an expert with JavaScript, Ajax and PHP. http://www.102freelancejob.com/javascript/expert-php-and-javascript-help-needed-to-troubleshoot-format-and-validation-on-form-by-esa2008/HOME |
I have looked at using this but i dont really no how it works i got this code but it did not seem to do anything.
Ext.Ajax.request({
form: 'file-form',
url: '/myUpload.do', // Optional if the form has the correct action attribute
params: { // Optional params that are temporarily added as hidden
type: 'jpg'
caption: 'A picture'
},
isUpload: true // Optional if the form has enctype="multipart/form-data" The Engineered Boulderer » Blog Archive » Help needed with the :: May 9, 2005 Help needed with the javascript event model in Internet Explorer. My Super Archive plugin is quite dependent on javascript and uses http://jonas.rabbe.com/archives/2005/05/09/help-needed-with-the-javascript-event-model-in-internet-explorer/HOME |
success: function() {
alert('File uploaded');
},
failure: {
alert('File could not be uploaded');
}
});
as i have not used this code before i am unsure as to where it will go and i placed it after my submit button which the code for it looks like this
Image 1
it might be a bit of a stupid question but i am trying to teach myself how to do this.
You can't upload files using XMLHttpRequest (that would be a security risk).
The only way to upload files without reloading the page is to post the form to a hidden IFRAME.
ps. Ext has support for this build into Ext.Ajax.request().
i have now went down the road of using iframes to upload the image. my page still reloads as i am still using the submit button. could i get round this by using javascript to submit the from the iframe. i would have to write my own function to handle the passing of the file to the upload.php page.
is it possible to do it in this way?
You could look at the code in Ext.Connection.doFormUpload
or you could google (http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html)...
Where's The Advantage In Windows Genuine Advantage?
Stocks Bounce After S&P Joins Bear Market
|