Solved

download to folder

Posted on 2014-11-07
2
161 Views
Last Modified: 2014-11-07
Hi, In cakephp I can download a file from the server as below.
It works fine and I get a window to save or open.

I dont want this window appearing as I want to download to a folder on my computer without this window appearing.
How can I code it to save to a specific folder  ?

$filename='Excel/'.$timesheet['TimeSheet']['excel_filename'];
$filesave=$timesheet['TimeSheet']['excel_filename'];
 debug($filename);
 
  $this->response->file($filename, array('download' => true, 'name' => $filesave));

Open in new window

0
Comment
Question by:jagguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
Kimputer earned 250 total points
ID: 40428378
There are standardized security measures. You will have to live with these prompts.
If these prompts aren't in place, I would just make a website where you wouldn't see any prompts of my malware downloading to your windows startup folder, and the next time you start your computer, I would have full control over your PC.
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 250 total points
ID: 40428427
The server can't tell the client whether to save a file, nor where to save it.  Also, the server cannot read a file from the client machine without an affirmative human-initiated signal.  HTTP Client/Server design does not allow it.

You might be able to get around some of this by writing your own browser application, maybe in Flash.  But that would seem like a lot of work, and everyone who wanted to use your site would need to install the application.  Executive summary: Look for another problem to solve.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question