We offer a powerful and customizable javascript library which allows you to integrate Fileboy into your applications in minutes.
The code snippet bellow is all you need to install Fileboy and it is as simple as it looks.
1 2 3 4 5 6<script> FILEBOY_PUBLIC_KEY = "YOUR-PUBLIC-KEY" </script> <script src="https://unpkg.com/@cd2/fileboy-browser@1.0.0"></script> <input type="hidden" data-fileboy name="my_file" />
The script tag imports all of the code needed to run Fileboy, the only thing you need to do is replace the `YOUR-PUBLIC-KEY` with your public key.
When this script loads it will automatically look for any inputs with the `data-fileboy` attribute and place an upload file button in their place.
The uploader can be configured to fit your requirements and flow naturally with the rest of your app. You can customize the uploader by passing different configuration to the fileboy attribute.
You can choose from different uploader styles by adding the
uploaderStyledefaultminimalbuttonOnlydefaultminimalbuttonOnly1<input type="hidden" data-fileboy="uploaderStyle=minimal" />
You can allow only certain file types by adding the
allow1<input type="hidden" data-fileboy="allow=image/*" />
Video has its own script: the
<fileboy-player>1 2 3 4 5 6<script type="module" src="https://cdn.jsdelivr.net/npm/@cd2/fileboy-player@1.2.0/dist/fileboy-player.js" ></script> <fileboy-player video-id="YOUR_VIDEO_ID" loop></fileboy-player>
Its attributes, events and styling, and the iframe alternative, are on Play a video.