Upload file from control application using Ajax button to submit

I have a control application that has a file upload field(Data Type(Document File Name) ) on it to upload files.
If I use the normal submit functionality the file can be accessed with $_SESSION[‘scriptcase’][‘app_name’][‘glo_nm_path_doc’] . “/” . {fileuploadedile} which is the normal Document Path of the application as set in the application setting eg /opt/NetMake/v81/wwwroot/scriptcase/file/doc/Content.doc

However, if I use an Ajax button to submit the control form, the behaviour is different , the file is uploaded and kept in a temporary location with a temp filename:
/opt/NetMake/v81/wwwroot/scriptcase/tmp/sc_e346a63d_Content.doc

Is this functioning as designed? Is it expected that I must move and rename the file “manually” ?

I have tried $_FILES[‘attach’][‘tmp_name’] , where ‘attach’ is the name of the file input field , this returns:
[SIZE=14px]array(1) { [0]=> string(0) “” }

The files array [/SIZE]$_FILES[‘attach’] returns:
[SIZE=14px]array(5) { [“name”]=> array(1) { [0]=> string(0) “” } [“type”]=> array(1) { [0]=> string(0) “” } [“tmp_name”]=> array(1) { [0]=> string(0) “” } [“error”]=> array(1) { [0]=> int(4) } [“size”]=> array(1) { [0]=> int(0) } }[/SIZE]

It’s blank? error=4
UPLOAD_ERR_NO_FILE
Value: 4; No file was uploaded

For some context here is a pic of the form, both buttons call the same php method… “Send Mail” is an ajax button. [ATTACH=CONFIG]n72707[/ATTACH]

email.png

In order to use this function you have to make an advanced deployment.
In there you fill in the path where your uploaded file which in your case was opt/NetMake/v81/wwwroot/scriptcase/tmp/sc_e346a63d_Content.doc is to be moved to.
The moment you close the form where the the scriptcase php code moves the file to that dir from the advanced deployment and it properly renames the file…

If you dont set a path it will automatically move the file in the img dir for images and doc (if I am not mistaken) of your application (dont get me on the details I dont recall it exactly).
So basically upload a file and then close your application and the file will be properly moved…
There is no own code needed unless you want to do special things.

No reason to fiddle with files arrays afaik.

Thanks, but this behaviour only occurs with the ajax button not with the default submit “OK” button provided ,so when I submit the form with the ok button it renames and moves the file as you describe. It doesn’t rename and move the file with the AJAX button. I can probably deal with moving the file myself, I just wanted to know if this behaviour is expected. Can’t see that it should be.