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

  • Home
  • SEARCH
  • 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 8685841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:40:46+00:00 2026-06-12T22:40:46+00:00

I have a page in symfony2 with a java applet and javascript functions that

  • 0

I have a page in symfony2 with a java applet and javascript functions that make the java applet load files. These files are user-dependant and each file has to be stored in the user folder.

Users have their folder in a directory located at the root of the symfony folder (/temp/). Now i need the files in these folders to be available (like an asset?).

// Controler ( What i have now )
$filepath = $this->get('kernel')->getRootDir().'/../temp/'.$userfolder;

// View ( what i would like -using twig )
{% set path = userfolder ~ '/' ~ filename %}
<a href="javascript:document.jmol.script('load {{ asset(path) }}; frame all');">link</a>
  • 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-06-12T22:40:48+00:00Added an answer on June 12, 2026 at 10:40 pm

    If your doc root is at the web directory, you cannot do what you are trying to do. This is the “root” directory which means you cannot access anything outisde it from the browser. This is a good thing, otherwise people browsing your site would be able to access other directories like your app security configuration, etc…

    You have several options:

    a) use a subdirectory of web to hold your user files, for example web/temp

    b) hold them somewhere else and copy them to a web subfolder as needed. This is what symfony does for assets

    c) create a new controller which intercepts routes like ‘temp/{user}/{filename}’ and then serves these files from the directory where you hold the files.

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

Sidebar

Related Questions

I have page where I load different videos.I use jw player as player if
I have a website that does not have page refreshes when the visitor navigates
I am using Symfony 1.3.2 and I have a page that uses a partial
So I have 2 models. Users and Groups. Each group has a user as
I have a symfony admin generator page where each row makes several function calls
I have been trying to setup Symfony2 on Windows so that I can use
I'm developing a simple page with Symfony2, using Twig as template engine. I have
I have found that the functional tests in Symfony2 always try to request pages
I have a Symfony2 Web application which requires user login to perform such useful
I have read that Pagerfanta is the pagination plugin of choice for Symfony2, but

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.