Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we have access to Non image extension file? #92

Open
patelmayankce opened this issue Nov 29, 2022 · 3 comments
Open

Can we have access to Non image extension file? #92

patelmayankce opened this issue Nov 29, 2022 · 3 comments

Comments

@patelmayankce
Copy link
Contributor

Currently i am trying to access PDF with params and it's not working.

if I am opening a PDF without passing params it works.

Working: uploads/tx_multishop/images/cmsfiles/61b9a1b55e1df.pdf
Not Working: uploads/tx_multishop/images/cmsfiles/61b9a1b55e1df.pdf?_gl=1*fpdze9

Configuration

const path = require('path');

module.exports = {
  imageStream: {
    http: [
      {
        port: process.env.PORT,
      },
    ],
    storage: {
      defaults: {
        driver: 'http',
        endpoint: process.env.IMAGE_ENDPOINT,
      },
      cache: {
        driver: 'fs',
        path: path.resolve(__dirname, '../storage/cache'),
      },
      cacheOptimized: {
        driver: 'fs',
        path: path.resolve(__dirname, '../storage/cacheOptimized'),
      },
      // cacheArtifacts: false,
      cacheTTS: process.env.CACHE_TTS || 600,
      cacheOptimizedTTS: process.env.CACHE_OPTIMIZED_TTS || 300,
      replicas: {
        otherPlace: {
          cache: {
            driver: 'fs',
            path: path.resolve(__dirname, '../storage/replica-cache'),
          },
          cacheOptimized: {
            driver: 'fs',
            path: path.resolve(__dirname, '../storage/replica-cacheOptimized'),
          },
        },
      },
    },
    processor: {
      sharp: {
        defaults: { animated: true, failOnError: false },
        cache: false,
      },
    },
  },
};

Please advice if is there anything i am missing in configuration?

@asilvas
Copy link
Owner

asilvas commented Nov 29, 2022

Image-steam is designed for images. It's just a convenience that non-image files are proxied so long as no image instructions are provided.

@patelmayankce
Copy link
Contributor Author

Thanks @asilvas , It's working as expected for PDF but when i pass params it's not, so is there any way where we can fix it?

@asilvas
Copy link
Owner

asilvas commented Nov 30, 2022

Thanks @asilvas , It's working as expected for PDF but when i pass params it's not, so is there any way where we can fix it?

PR welcome. Otherwise might be a while before I pick it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants