Hello
How can I download a longblog file using a download button? How can I download it in Nubuilder 3?
Can I write you in Spanish?
Nubuilder 2 Code:
// get record from db using parameter passed through runIt() via a hash id
$sql ="SELECT * FROM documentos where doocumento_id='#recordID#'";
nuDebug($sql);
$rs=nuRunQuery($sql);
$fileObj=db_fetch_object($rs);
// set headers
header ("Content-type:$fileObj->archivo_file_type");
header("Content-Disposition:attachment;filename=$fileObj->archivo_file_name");
header("Pragma:private");
header("Cache-control:private.must-revalidate");
// echo file data
echo $fileObj->archivo;
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Download Longblog
Re: Download Longblog
cjuliao,
You should be able to create a Procedure and run it from a Form via a Extra Action Button with nuRunPHP() http://wiki.nubuilder.net/index.php/Jav ... C_id.5D.29
(#recordID# will need to be #RECORD_ID#)
Steven
You should be able to create a Procedure and run it from a Form via a Extra Action Button with nuRunPHP() http://wiki.nubuilder.net/index.php/Jav ... C_id.5D.29
(#recordID# will need to be #RECORD_ID#)
Steven
Re: Download Longblog
the code does not work
I have bad?
nuRunPHP(pCode [, id])
OBJECT
type : Button
Events :
Event Name: onclick
Javascript: nuRunPHP(SHOWFILE_DOCUMENT,doocumento_id);
PHP Code
Details
Code: SHOWFILE_DOCUMENT
Description: muestra_archivos
Group: Display Files
Criteria Form:
Allow Non Secure Acces: NO
PHP CODE
PHP: //$sql ="SELECT * FROM documentos where doocumento_id=#RECORD_ID#";
nuDebug($sql);
$rs=nuRunQuery($sql);
$fileObj=db_fetch_object($rs);
// set headers
header ("Content-type:$fileObj->archivo_file_type");
header("Content-Disposition:attachment;filename=$fileObj->archivo_file_name");
header("Pragma:private");
header("Cache-control:private.must-revalidate");
// echo file data
echo $fileObj->archivo;
I have bad?
nuRunPHP(pCode [, id])
OBJECT
type : Button
Events :
Event Name: onclick
Javascript: nuRunPHP(SHOWFILE_DOCUMENT,doocumento_id);
PHP Code
Details
Code: SHOWFILE_DOCUMENT
Description: muestra_archivos
Group: Display Files
Criteria Form:
Allow Non Secure Acces: NO
PHP CODE
PHP: //$sql ="SELECT * FROM documentos where doocumento_id=#RECORD_ID#";
nuDebug($sql);
$rs=nuRunQuery($sql);
$fileObj=db_fetch_object($rs);
// set headers
header ("Content-type:$fileObj->archivo_file_type");
header("Content-Disposition:attachment;filename=$fileObj->archivo_file_name");
header("Pragma:private");
header("Cache-control:private.must-revalidate");
// echo file data
echo $fileObj->archivo;