The only restriction is that the file cannot be dangerous according to unstable_type_unsafe in the file itself and if the file is not dangerous then it can be uploaded. In general, uploading files with type “stretch”, “default” is not a problem. But sometimes we want to upload other file types like .jpg, .png, .txt, .pdf, .mp3, .aiff, .wav, .avi, etc. And uploading such file types are not a problem in general. But then how we can upload these file types in a safe manner (avoiding GitHub’s dangerous type warning) without any issues? This is where S3Upload plugin comes into picture. That’s right, S3Upload plugin helps you to upload any file type in a safe manner. It does that by checking file type before uploading. Here’s how you can use this plugin, let’s assume you have a plugin file named plugin.yml in your plugin directory. You can have multiple plugin.yml files, one plugin.yml file per each plugin. You can have multiple plugin.yml files, one plugin.yml file per each plugin. In this plugin.yml file, you can add the following code, which allows you to upload plugin.zip files in a safe way. s3_type_rules: - 'octoprint/octoprint' You can have

Installation Instructions:

1. Go to the plugin’s GitHub page here: https://github.com/InflowCreator/S3Upload
2. Click on “Download ZIP” button
3. Unzip the downloaded file and upload plugin-master folder to your Octoprint server. 4. Open the file in your web browser or download it so that you can edit it locally, then save a new plugin-master file with your changes 5. Upload your plugin-master file to your Octoprint server using FTP
6. That’s all you have to do! Now when you run S3Upload for the first time, it will check for any .zip files in your plugin directory and if there are any .zip files (for example, plugins/*.zip) then it will show up a warning message saying “Please use s3_type_rules section of config file." 7. After that warning message, click on "OK" button to continue with uploading process 8. If you want to be 100% sure that there is no dangerous type file in your plugin directory, then go ahead and add the following code - 'octoprint/octoprint' 9. That's not all; after checking for any .zip files in your plugin directory, it will proceed with uploading process else it will show an error message saying "No s3_type_rules section found." 10. Now when you upload a zip file using S3

Installing S3Upload Plugin

The first step is installing the plugin. In order to install S3Upload plugin, you need to run the following command:

composer require "octoprint/octoprint-s3upload-plugin"

Next, you need to configure your plugin directory. You can do this in a few ways. For example, you can create a file called config.php (or something similar) and put the following code in it:
/** The name of your plugin **/
$this->name = 'My Plugin';
/** Which folder should WordPress look for your plugin **/
$this->directory = '/path/to/your/plugin'; /** Where should WordPress look for plugins **/ $this->url = '/path/to/your/folder';

What is S3Upload Plugin?

S3Upload is a plugin for the YAML-based configuration file format used in many applications. It allows users to upload files directly to Amazon S3 without worrying about the file's actual type, size, or content.
In general, uploading files with type “stretch”, “default” is not a problem. But sometimes we want to upload other file types like .jpg, .png, .txt, .pdf, .mp3, .aiff, .wav, .avi, etc. And uploading such file types are not a problem in general. But then how we can upload these file types in a safe manner (avoiding GitHub’s dangerous type warning) without any issues? This is where S3Upload plugin comes into picture. That’s right, S3Upload plugin helps you to upload any file type in a safe manner. It does that by checking file type before uploading. Here’s how you can use this plugin, let’s assume you have a plugin file named plugin.yml in your plugin directory. You can have multiple plugin.yml files, one plugin.yml file per each plugin. In this plugin.yml file, you can add the following code: s3_type_rules: - 'octoprint/octoprint'

How to Use S3Upload Plugin?

1. Create an S3 bucket
2. Enable the S3Upload plugin
3. Configure the plugin
4. Upload your file
5. Check if file was uploaded properly

Timeline

Published on: 09/21/2022 10:15:00 UTC
Last modified on: 09/23/2022 17:58:00 UTC

References