Created
June 10, 2009 13:55
-
-
Save klederson/127222 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Abrindo o arquivo para leitura e conversão em STRING | |
$fp = fopen($tmpName, 'r'); //$tmpName é o nome e caminho completos para o arquivo em disco | |
//Lendo o arquivo carregado para uma STRING | |
$content = fread($fp, filesize($tmpName)); | |
//Fechando a conexao com o arquivo | |
fclose($fp); | |
//Adicionando slashes para segurança | |
if(!get_magic_quotes_gpc()) { | |
$fileName = addslashes($fileName); | |
} | |
Lumine::import('OrderProducts'); | |
$orderProductId = $_REQUEST['hidden_id'][$index]; | |
$orderProduct = new OrderProducts(); | |
$orderProduct->get($orderProductId); | |
//Setando a variavel ( banco ) que irá receber o arquivo | |
$orderProduct->content = $content; | |
$orderProduct->content_name = $fileName; | |
$orderProduct->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment