can a plugin stop a upload?
-
I am new to wordpress, but a customer wants one of my scripts converted into a wordpress plugin.
The basic idea of the script is when a file is uploaded with a specific filetype, then start decoding it (private In-company filetype)
Now, while it is being processed, is there a way to edit the “crunching….” text to display status of the decoding?
Also, if the decode fails, then it CANT BE UPLOADED… is there a way to reject the file and stop the upload process?
code:
add_action('wp_handle_upload', 'filetype_check'); function filetype_check($results) { if ($results['type'] == "D3m58") { Process($results['file']); $result2 = wordingcheck(textdecode($decodedtext); if ($result2 != "") { echo "upload failed, following reasons: <br>\n" . $result2; die(); } } }
The text should be placed inside the loading bar instead of the current Crunching.
Instead of die(), I want the upload to abort.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘can a plugin stop a upload?’ is closed to new replies.