Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

django-s3-file-field

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-s3-file-field

A Javascript client library for django-s3-file-field.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
3
Created
Source

django-s3-file-field-client

npm

A Javascript (with TypeScript support) client library for django-s3-file-field.

Installation

npm install django-s3-file-field

or

yarn add django-s3-file-field

Usage

import axios from 'axios';
import S3FileFieldClient, { S3FileFieldProgress, S3FileFieldProgressState } from 'django-s3-file-field';

function onUploadProgress (progress: S3FileFieldProgress) {
  if (progress.state == S3FileFieldProgressState.Sending) {
    console.log(`Uploading ${progress.uploaded} / ${progress.total}`);
  }
}

const apiClient = axios.create(...); // This can be used to set authentication headers, etc.

const s3ffClient = new S3FileFieldClient({
  baseUrl: process.env.S3FF_BASE_URL, // e.g. 'http://localhost:8000/api/v1/s3-upload/', the path mounted in urlpatterns
  apiConfig: apiClient.defaults, // This argument is optional
});

// This might be run in an event handler
const file = document.getElementById('my-file-input').files[0];

const fieldValue = await s3ffClient.uploadFile(
  file,
  'core.File.blob', // The "<app>.<model>.<field>" to upload to,
  onUploadProgress, // This argument is optional
);

apiClient.post(
  'http://localhost:8000/api/v1/file/', // This is particular to the application
  {
    'blob': fieldValue, // This should match the field uploaded to (e.g. 'core.File.blob')
    ...: ...,  // Other fields for the POST request
  }
);

FAQs

Package last updated on 30 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts