1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

PHP Guys panu mag save ng pptx file using php

Discussion in 'Coding, Programming' started by vinzoimartinez, Jan 13, 2016.

  1. 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);

    $fileName = addslashes($fileName);

    $query = "INSERT INTO upload (name, size, type, content,book,description,chapter) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$content','{$_POST['book']}','{$_POST['description']}','{$_POST['title']}')";
  2. add ka sa directory path location para sa storage mo
  3. boss gusto ko mismong file ilagay sa database para downloadable sya pag inupload ko ung site ko
  4. -----------ito kc ginagamit ko para sa download
    <a href="location/powerpoint.pptx" download="powerpoint.pptx">
  5. 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
  6. google or ÿôutubê sir dami guide dun
  7. be sure na ang filename mo walang spaces, dapat i-replace mo sya ng underscore symbol (_). kasi hindi siya mada-download.
Tags / Keywords:

Share This Page