What's new

Closed Guys panu mag save ng pptx file using php

Status
Not open for further replies.
Joined
Sep 4, 2015
Posts
45
Reaction
1
Points
83
Age
30
mga boss pano ba mag save ng powerpoint presentation sa php my code works in other file but it is not in the powerpoint
ito po ung code ko
if(isset($_POST['upload']) )
{
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$_FILES['userfile']['type'] = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
$fileType = $_FILES['userfile']['type'];

$fp = fopen($tmpName, 'r');
$content = fread($fp, filesize($tmpName));
$content = addslashes($content);
fclose($fp);

if(!get_magic_quotes_gpc())
{
$fileName = addslashes($fileName);
}
include('connection.php');

$query = "INSERT INTO upload (name, size, type, content,book,description,chapter) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content','{$_POST['book']}','{$_POST['description']}','{$_POST['title']}')";
}
 
mag wowork po yan kung ung file is naka save po sa computer mo since na ung file is nasa directory ng computer mo but i think if you upload your site in the internet di nya na po mai dodownload yan kasi di nya na makikita ung path directory kaya ang aim ko po is isave ung mismong file sa mysql database so ung user pwedeng i download ung file direct from my database

ok na solved na ung problem ko lang pala dapat pala nasa taas na taas sya ng mga tag bago mag simula ung <html> na tag hahahahah thanks nalang po boss asrock1821
 
be sure na ang filename mo walang spaces, dapat i-replace mo sya ng underscore symbol (_). kasi hindi siya mada-download.
 
Dear vinzoimartinez,

Since 2 years have passed since the last reply in this thread, I am locking it to prevent necroposting. Feel free to start a new thread or contact any forum staff if you want this to be reopened.

Thread closed.
 
Status
Not open for further replies.

Similar threads

Back
Top