Gathering detailed insights and metrics for uploader
Gathering detailed insights and metrics for uploader
Gathering detailed insights and metrics for uploader
Gathering detailed insights and metrics for uploader
Uploader
vue-simple-uploader
A Vue.js upload component powered by simple-uploader.js
@uppy/utils
Shared utility functions for Uppy Core and plugins maintained by the Uppy team.
@uppy/core
Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:
npm install uploader
Typescript
Module System
Node Version
NPM Version
TypeScript (85.5%)
SCSS (9.85%)
JavaScript (4.61%)
Shell (0.04%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
103 Stars
702 Commits
12 Forks
2 Watchers
2 Branches
2 Contributors
Updated on Jun 05, 2025
Latest Version
3.48.3
Package Id
uploader@3.48.3
Unpacked Size
265.08 kB
Size
55.82 kB
File Count
72
NPM Version
8.19.3
Node Version
16.19.0
Published on
Oct 19, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
44
File & Image Upload Widget
(With Integrated Cloud Storage)
100% Serverless File Upload Widget
Powered by Bytescale
DMCA Compliant • GDPR Compliant • 99.9% Uptime SLA
Supports: Rate Limiting, Volume Limiting, File Size & Type Limiting, JWT Auth, and more...
Install via NPM:
1npm install uploader
Or via YARN:
1yarn add uploader
Or via a <script>
tag:
1<script src="https://js.bytescale.com/uploader/v3"></script>
Initialize once at the start of your application:
1// Ignore if installed via a script tag. 2const { Uploader } = require("uploader"); 3 4// Get production API keys from Bytescale 5const uploader = Uploader({ 6 apiKey: "free" 7});
1uploader.open({ multi: true }).then(files => { 2 if (files.length === 0) { 3 console.log('No files selected.') 4 } else { 5 console.log('Files uploaded:'); 6 console.log(files.map(f => f.fileUrl)); 7 } 8}).catch(err => { 9 console.error(err); 10});
.open()
returns Promise<Array<UploaderResult>>
:
1{ 2 fileUrl: "https://upcdn.io/FW25...", // URL to use when serving this file. 3 filePath: "/uploads/example.jpg", // File path (we recommend saving this to your database). 4 5 editedFile: undefined, // Edited file (for image crops). Same structure as below. 6 7 originalFile: { 8 fileUrl: "https://upcdn.io/FW25...", // Uploaded file URL. 9 filePath: "/uploads/example.jpg", // Uploaded file path (relative to your raw file directory). 10 accountId: "FW251aX", // Bytescale account the file was uploaded to. 11 originalFileName: "example.jpg", // Original file name from the user's machine. 12 file: { ... }, // Original DOM file object from the <input> element. 13 size: 12345, // File size in bytes. 14 lastModified: 1663410542397, // Epoch timestamp of when the file was uploaded or updated. 15 mime: "image/jpeg", // File MIME type. 16 metadata: { 17 ... // User-provided JSON object. 18 }, 19 tags: [ 20 "tag1", // User-provided & auto-generated tags. 21 "tag2", 22 ... 23 ] 24 } 25}
Uploader contains a built-in image cropper:
The cropper appears by default, but can be disabled with crop: false
(see examples below):
1uploader 2 .open({ 3 multi: false, 4 mimeTypes: ["image/*"], 5 editor: { 6 images: { 7 crop: true, 8 cropShape: "circ", // "rect" also supported. 9 cropRatio: 1 / 1 // "1" is enforced for "circ". 10 } 11 } 12 }) 13 .then(files => alert(JSON.stringify(files)));
The image cropper uses server-side image cropping, and works like so:
filePath
in the result will reference the original image.filePath
.
filePath
in the result will reference the JSON file.1uploader.open().then(files => alert(JSON.stringify(files)));
1uploader.open({ multi: true }).then(files => alert(JSON.stringify(files)));
You can use Uploader as a dropzone — rather than a modal — by specifying layout: "inline"
and a container:
1uploader.open({ 2 multi: true, 3 layout: "inline", 4 container: "#example_div_id", // Replace with the ID of an existing DOM element. 5 onUpdate: (files) => console.log(files) 6})
Note:
position: relative
, width
and height
on the container div
.Finish
button is hidden by default in this mode (override with "showFinishButton": true
).All configuration is optional.
1uploader 2 .open({ 3 container: "body", // "body" by default. 4 layout: "modal", // "modal" by default. "inline" also supported. 5 locale: myCustomLocale, // EN_US by default. (See "Localization" section below.) 6 maxFileCount: 5, // Unlimited by default (or 1 if multi: false). 7 maxFileSizeBytes: 1024 ** 2, // Unlimited by default. 8 mimeTypes: ["image/*"], // Unrestricted by default. Supports * wildcard suffix. 9 multi: false, // False by default. 10 onInit: ({ // Exposes lifecycle methods for the component. 11 close, // Closes the widget when called. 12 reset, // Resets the widget when called. 13 updateConfig // Updates the widget's config by passing a new config 14 }) => {}, // object to the method's first parameter. 15 onUpdate: files => {}, // Called each time the list of uploaded files change. 16 onPreUpload: async file => ({ 17 errorMessage: "Uh oh!", // Displays this error message to the user (if set). 18 transformedFile: file // Uploads 'transformedFile' instead of 'file' (if set). 19 }), 20 showFinishButton: true, // Show/hide the "finish" button in the widget. 21 showRemoveButton: true, // Show/hide the "remove" button next to each file. 22 styles: { 23 colors: { 24 primary: "#377dff", // Primary buttons & links 25 active: "#528fff", // Primary buttons & links (hover). Inferred if undefined. 26 error: "#d23f4d", // Error messages 27 shade100: "#333", // Standard text 28 shade200: "#7a7a7a", // Secondary button text 29 shade300: "#999", // Secondary button text (hover) 30 shade400: "#a5a6a8", // Welcome text 31 shade500: "#d3d3d3", // Modal close button 32 shade600: "#dddddd", // Border 33 shade700: "#f0f0f0", // Progress indicator background 34 shade800: "#f8f8f8", // File item background 35 shade900: "#fff" // Various (draggable crop buttons, etc.) 36 }, 37 fontFamilies: { 38 base: "arial, sans-serif" // Base font family (comma-delimited). 39 }, 40 fontSizes: { 41 base: 16 // Base font size (px). 42 } 43 }, 44 path: { // Optional: a string (full file path) or object like so: 45 fileName: "Example.jpg", // Supports path variables (e.g. {ORIGINAL_FILE_EXT}). 46 folderPath: "/uploads" // Please refer to docs for all path variables. 47 }, 48 metadata: { 49 hello: "world" // Arbitrary JSON metadata (saved against the file). 50 }, 51 tags: ["profile_picture"], // Requires a Bytescale account. 52 editor: { 53 images: { 54 preview: true, // True by default if cropping is enabled. Previews PDFs and videos too. 55 crop: true, // True by default. 56 cropFilePath: image => { // Choose the file path used for JSON image crop files. 57 const {filePath} = image // In: https://www.bytescale.com/docs/upload-api/types/FileDetails 58 return `${filePath}.crop` // Out: https://www.bytescale.com/docs/upload-api/types/FilePathDefinition 59 }, 60 cropRatio: 4 / 3, // Width / Height. Undefined enables freeform (default). 61 cropShape: "rect" // "rect" (default) or "circ". 62 } 63 }, 64 }) 65 .then(files => alert(files))
Default is EN_US:
1const myCustomLocale = { 2 "error!": "Error!", 3 "done": "Done", 4 "addAnotherFile": "Add another file...", 5 "addAnotherImage": "Add another image...", 6 "cancel": "cancel", 7 "cancelInPreviewWindow": "Cancel", 8 "cancelled!": "cancelled", 9 "continue": "Continue", 10 "customValidationFailed": "Failed to validate file.", 11 "crop": "Crop", 12 "finish": "Finished", 13 "finishIcon": true, 14 "image": "Image", 15 "maxFilesReached": "Maximum number of files:", 16 "maxImagesReached": "Maximum number of images:", 17 "maxSize": "File size limit:", 18 "next": "Next", 19 "of": "of", 20 "orDragDropFile": "...or drag and drop a file.", 21 "orDragDropFiles": "...or drag and drop files.", 22 "orDragDropImage": "...or drag and drop an image.", 23 "orDragDropImages": "...or drag and drop images.", 24 "pleaseWait": "Please wait...", 25 "removed!": "removed", 26 "remove": "remove", 27 "skip": "Skip", 28 "unsupportedFileType": "File type not supported.", 29 "uploadFile": "Upload a File", 30 "uploadFiles": "Upload Files", 31 "uploadImage": "Upload an Image", 32 "uploadImages": "Upload Images", 33 "validatingFile": "Validating file..." 34}
Bytescale provides an Upload API, which supports the following:
Uploading a "Hello World"
text file is as simple as:
1curl --data "Hello World" \ 2 -u apikey:free \ 3 -X POST "https://api.bytescale.com/v1/files/basic"
Note: Remember to set -H "Content-Type: mime/type"
when uploading other file types!
Bytescale also provides an Image Processing API, which supports the following:
Read the Image Processing API docs »
Here's an example using a photo of Chicago:
https://upcdn.io/W142hJk/raw/example/city-landscape.jpg
Using the Image Processing API, you can produce this image:
https://upcdn.io/W142hJk/image/example/city-landscape.jpg
?w=900
&h=600
&fit=crop
&f=webp
&q=80
&blur=4
&text=WATERMARK
&layer-opacity=80
&blend=overlay
&layer-rotate=315
&font-size=100
&padding=10
&font-weight=900
&color=ffffff
&repeat=true
&text=Chicago
&gravity=bottom
&padding-x=50
&padding-bottom=20
&font=/example/fonts/Lobster.ttf
&color=ffe400
Yes: Bytescale supports AWS S3, Cloudflare R2, Google Storage, and DigitalOcean Spaces.
To configure a custom storage backend, please see:
https://www.bytescale.com/docs/storage/sources
Uploader is the Upload Widget for Bytescale: the best way to serve images, videos, and audio for web apps.
No vulnerabilities found.
No security vulnerabilities found.