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
<script language="javascript">
function submitForm()
{
var http = null;
if(window.XMLHttpRequest)
http = new XMLHttpRequest();
else if (window.ActiveXObject)
http = new ActiveXObject(
can the Ext.Ajax.request be used as a stand alone or do i need the ext.lib to use it.
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"
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
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.