Coder Social home page Coder Social logo

force_download's Introduction

Force Download

When this event is attached to a page, it enables the page to force a download. The download can be triggered by adding the parameter file to the URL:

<a href="/download/?file=workspace/uploads/manual.pdf">Download manual</a>

Security

To prevent that anyone can download any file from your website you have to set which folders are allowed for visitors to download files of. Otherwise evil people can download your config-settings for example simply by changing the URL in the browser bar to: /download/?file=manifest/config.php.

To do this, you need to add a list of trusted locations to the 'Force Download'-section on the preferences page.

Download the current page

You can also download the page itself, by adding the parameter download to the URL. The value of this parameter will be the name of the file. For example:

<a href="/sheet/?download=sheet.xml">Download sheet in XML-format</a>

Default Download Directory

The first directory listed in $allowedDirs will act as a default download directory if you do not wish to include a path in the ?file= parameter. For example, if the first entry in $allowedDirs is workspace/uploads then a GET request of ?file=my-example-file.pdf will download the file workspace/uploads/my-example-file.pdf

Missing or Unauthorised Files

Requests for files that cannot be found on the filesystem, or are not included in the $allowedDirs will show Symphony's 404 page.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.