Some files are deleted from the files table after CRON execution
file_save_upload():


  The source file is validated as a proper upload and handled as such.
  The file will be added to the files table as a temporary file.
  Temporary files are periodically cleaned. To make the file permanent
  file call file_set_status() to change its status.


You need to use file_set_status() to change the status of the file.

  $save = file_save_upload('image', array(), $dir);
  if($save-&gt;fid) {
    file_set_status($save,FILE_STATUS_PERMANENT);
    ...