PHP code is performed Top Down.
The Server File name Variable is created When the file uploads.
if the Upload File Behavior comes after the Insert Record behavior, then the Server File name will not have been created.
So moving the code may have alleviated the errors, but it did not fix the problem from your other thread.
lets move the insert record behavior back where it was and look into the cause of the error you where getting. can you send a copy of your k9_SaD_Insert.php page that is generating the error message so I can examine the code?