Solved

download to folder

Posted on 2014-11-07
2
158 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
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 109

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

839 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