New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

payload-hash-upload

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

payload-hash-upload

This plugin ensures safe filenames with PayloadCMS database. Resized images are properly supported.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Append a hash to upload filenames in Payload CMS, and optimize your CDN caching strategy

This plugin ensures safe filenames with PayloadCMS database.
Resized images are properly supported.

Install

npm install payload-hash-upload

Get Started

Enable plugin in Payload CMS config

import { buildConfig } from 'payload/config';
import hashUpload from 'payload-hash-upload';

export default buildConfig({
  // ...
  plugins: [
      hashUpload,
  ],
});

Configure your upload collections

const Media = {
  slug: 'media',
  upload: {
    staticURL: '/assets',
    staticDir: 'assets',
    hash: {
      algorithm: 'md5', // any algo compatible with Node.js crypto.createHash
      truncate: 10, // optional, for shorter hashes
    },
  },
};

export default Media;

Result

chnux.png -> chnux.9cdfb439c7.png

FAQs

Package last updated on 18 Aug 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc