Hey guys.
I'm currently working on an application integrated into Facebook allowing people to create files using a form for user input in which they can post the files to facebook and also download them.
At present, files can be created, downloaded and posted to facebook.
The next part I want to figure out is how to allow users that have clicked on the posted link to also download these files and not just the user who has created it.
The problem is, I know what needs to happen, but I dont know how to make it happen!
Here is the code I have to download files:
And here is the code used to reference my created file:
(gameconfigid being the var that needs to be passed to the created file page)
Does anyone understand what I'm trying to achieve and if so... Could they tell me what needs to happen?
I'm currently working on an application integrated into Facebook allowing people to create files using a form for user input in which they can post the files to facebook and also download them.
At present, files can be created, downloaded and posted to facebook.
The next part I want to figure out is how to allow users that have clicked on the posted link to also download these files and not just the user who has created it.
The problem is, I know what needs to happen, but I dont know how to make it happen!
Here is the code I have to download files:
PHP:
$myFile = $_GET['file'];
if(!file_exists($myFile))
{
die('Error: File does not exist');
}
else
{
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$myFile");
header("Content-type: text/plain");
readfile($myFile);
}
And here is the code used to reference my created file:
PHP:
<input type="button" onclick="window.location='downloadFile.php?file=<?php echo $gameconfigid;?>' " name="downloadBtn" value="Download">
(gameconfigid being the var that needs to be passed to the created file page)
Does anyone understand what I'm trying to achieve and if so... Could they tell me what needs to happen?