![]() Now that you know how implement PHP file uploads two ways, you can easily add this feature to your website or application. In addition, if you want to see more examples of how the file upload picker can be integrated into a form check out these links: Test if a file upload is “safe for work”.Using the Filestack PHP SDK allows you to perform a variety of tasks on your uploaded files. When this script is run, the result of the safe-for-work check will be saved in the $json_result variable. $json_result = $filelink->getSafeForWork() $filelink = new Filelink($file_handle, YOUR_API_KEY, $security) Create a new file called fileUploadFilestack.php and add the following (making sure to change the YOUR_API_KEY, YOUR_SECURITY_SECRET, and YOUR_FILE_HANDLE variables): getTags($file_handle) Now that we have the Filestack library, let’s make a new PHP script to check if a specific uploaded file is safe for work. Then run require -prefer-dist filestack/filestack-php to install the Filestack SDK. Then add this code: 4000000) echo PHP_EOL "Īfter you do the above, you should be able to see Composer’s output by running php composer.phar. ![]() Notice that this is the same name as the action attribute in the form. Then, in the same directory as index.html, create a file called fileUploadScript.php. This will be where our script will save the files. First, in the same directory, create a new directory called uploads. ![]() ![]() Next, we’ll handle the backend of the file upload. Then, open your web browser and go to localhost:1234. Next, open your terminal and from the directory where you created the file, start the PHP server:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |