Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6962293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:38:31+00:00 2026-05-27T15:38:31+00:00

In my app I have a module named client. I wish to create a

  • 0

In my app I have a module named “client”. I wish to create a sub directory “statements” and below that “accounts” then “account_123” and within this directory the pdfs representing statements for clint 123.
Structure client then statements then accounts then acount_XXX and the pdf files.

The problem

<a href=What_is_the_url_for">statement_1.pdf</a>?

Being MVC I am making little progess.

I moved the structure to public and it almost wotk except I could not retrieve dynamically the hostname i.r. http://www.hostnam.com/client/statement….

I know this is a security issue so I have moved the directory back yo below the client module.

Any help will be appreciayed.

TIA Ephraim

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:38:31+00:00Added an answer on May 27, 2026 at 3:38 pm

    As far as I know you can’t place a direct link to a file placed under ‘application’ director (because of security issues as you already wrote), so one of possible solution is to make an action which read the content of a file and return it in a response object.

    When user click a link to this action user get a window to open/save provided file.

    Example:

    public function exampleAction() {
        $this->_helper->layout->disableLayout();
        $this->_helper->viewRenderer->setNoRender(true);
    
        /* ... */
    
        $file = "FILENAME WITH_PATH";
        $response = $this->getResponse();
        $response->setHeader('Cache-Control', 'public', true);
        $response->setHeader('Content-Description', 'public', true);
        $response->setHeader('Content-Disposition', 'attachment; filename=' . FILENAME, true);
        $response->setHeader('Content-Type', FILETYPE, true);
        $response->setHeader('Content-Transfer-Encoding', 'binary', true);
        $response->setHeader('Content-Length', filesize($file), true);                    
        $response->setBody(file_get_contents($file));
    }
    

    I put in above code some constants because its values depends on your application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have module application. When I run it, the main window of that app
I have a Python app that works fine. Now I use py2exe to create
I am looking at this github app, and they have a module named AuthenticatedSystem.
While developing my app I have come to realize that the majority of my
The story so far: I have a rails app with a model named Term.
I have a python/django application that runs on the google app engine. My views.py
I have a suite of App Engine tests that are called using nose .
I have a pyobjc app running in a 32-bit only python build that makes
I have problems with importing correctly a module on appengine. My app generally uses
In my app have a window splitted by a QSplitter, and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.