Ajax Upload file
Hi,
i have a table TABLE1 with a CLOB field FI_LOB (among other normal fields)
An On Demand Process AddFile that will insert a line into TABLE1 using the parameters given
And a page P4, which has a Modal Form using jQuery, the JS looks like that :
<script type="text/javascript">
$( function() {
$('#ModalFormFile').dialog(
{
modal : true ,
autoOpen : false ,
buttons : {
Cancel : function() {
closeForm();
} ,
Add : function() {
addFile();
}
}
});
});
function openForm()
{
$('#ModalFormFile').dialog('open');
}
function closeForm()
{
$('#ModalFormFile input[type="text"]').val('');
$('#ModalFormFile').dialog('close');
}
function addFile()
{
var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=AddFile', 0);
ajaxRequest.add( 'P4_USR_ID', $v('P4_USR_ID'));
ajaxRequest.add( 'P4_FI_NAME', $v('P4_FI_NAME'));
ajaxRequest.add( 'P4_FI_LOB', $v('P4_FI_LOB'));
ajaxRequest.add( 'P4_FI_DATE', $v('P4_FI_DATE'));
ajaxRequest.add( 'P4_FI_DESC', $v('P4_FI_DESC'));
ajaxRequest.add( 'P4_FI_TYPE', $v('P4_FI_TYPE'));
var gReturn = ajaxRequest.get();
//gReturn =0;
if(gReturn)
{ alert(gReturn) }
else
{ ajaxRequest = null;
closeForm();
doSubmit('SEARCH'); }
}
</script>
This ajax "form" works well , except for the LOB part
Question is : how do i upload the file without submiting the page ?