Save file by click


Posted on 16th Feb 2014 07:03 pm by admin

Hello.
I'm not understand how to save file from page. I'd like make link to file with save ability.
<?php
chdir('upload/');
foreach (glob("*.*") as $filename)
{
$uploadfile = $_GET['file'];
readfile ('upload/'.$uploadfile);
echo "<a href='upload.php? file=$uploadfile'> $filename </a> </p>";
}
?>
and msg appear: Warning: readfile(upload/) [function.readfile]: failed to open stream: No such file or directory in ..

Thanks

No comments posted yet

Your Answer:

Login to answer
134 Like 9 Dislike
Previous forums Next forums
Other forums

XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

Trouble with a select list
Hello All!
I was wondering if any of you guys could help me with a small problem I'm having!

Must-Know Topics of PHP
Can you guys list the must-know topics of PHP. I am still a learner and I am trying to cover most of

On page view, minus credit
Hello all, please, I need a little help with this script. I am charging one credit (credits can be p

undefined offset help
Hi All,

I kept getting undefined offset PHP notice for a simple for loop. For eg
$va = arr

Simple MySQL script is not working
Hey guys,

Just familiarizing myself with PHP and MySQL. I am following along in the O'Reilly

is_dir() problem
Hello,

I'm buidling a php scripts that dynamically get's subfolders from a specific folder.

I need an iframe that calls up a different page according to the date
hi

I don't know any php (only html) and I urgently need to do the following:

I need a

Help building / using array
First - this is a cross-posting, if this is wrong I apologise! What started out as a MySQL query que

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash