When a file is uploaded and processed, WS Form moves the uploaded file from its temporary source path to a final destination. That destination depends on the file handler you have selected, such as WS Form Private, WS Form Public, or the WordPress Media Library.
If you encounter the error Unable to move file to destination, it means WS Form was not able to move the uploaded file from the temporary location to the intended destination directory.
Below are the most common reasons why this can occur and how to resolve them.
File Permissions
When WS Form moves a file, two steps are performed:
- The file is copied from the source path to the destination path.
- The original source file is deleted.
These actions use the WordPress WP_FileSystem move method. For the process to work correctly, both the source and destination paths must allow your web server to read, write, and remove files as needed.
Source Path
The source path for uploaded files depends on your hosting environment. It is typically one of the following:
- The
upload_tmp_dirvalue set in php.ini (if configured) - Your system temporary directory, such as
/tmpon Linux servers
Confirm that the web server user has read and write permissions for this directory. Without the correct access, WS Form cannot retrieve or remove the temporary upload file.
Destination Path
The destination path is determined by the File Handler selected in your WS Form settings. Common paths include:
WS Form Private: /wp-content/uploads/ws-form/<form_id>/
WS Form Public: /wp-content/uploads/ws-form/<form_id>/
Media Library: /wp-content/uploads/<year>/<month>/
The web server must have write permissions for whichever directory applies. If the server cannot write to the destination directory, the file move process will fail.