This is a sample application demonstrating how to use the @clouduploader/clouduploader-js package for cloud file uploads.
The package has already been installed via npm:
npm install @clouduploader/clouduploader-jssample-js-app/
├── index.js # Main application file with usage examples
├── package.json # Project configuration
├── package-lock.json # Dependency lock file
├── README.md # This file
└── node_modules/ # Installed packages
The index.js file contains several example functions:
- uploadFile() - Basic file upload
- uploadFolder() - Upload whole folder in one go.
const CloudUploader = require('@clouduploader/clouduploader-js');
const uploader = new CloudUploader({
// Add your configuration here
});
// Upload a file
const result = await uploader.upload('./sample-file.txt');-
Configure your CloudUploader credentials in
index.js:const uploader = new CloudUploader({ // Add your apiKey, bucket, region, etc. });
-
Uncomment the example function you want to run in the
main()function -
Run the app:
node index.js
Refer to the official CloudUploader documentation for detailed API usage and configuration options.
- Integrate the uploader into your application
- Add error handling and validation
- Implement progress tracking for large file uploads
- Add retry logic for failed uploads
ISC