regoch Posted January 18, 2012 Share Posted January 18, 2012 1. How big pdf file can be uploaded to hosting? I work on page for news company, and they won.t to upload via cms actual number of news. Is it posible via cms or must be via ftp. I got this script for upload pdf that working fine. <form action="" method="post" name="fileForm" id="fileForm" enctype="multipart/form-data"> <center> <table> <tr><td style="width:150px;">Naziv PDF-a HR: </td><td><input name="pdf_ime_hr" type="text" class="textfield" id="pdf_ime_hr" /></td></tr> <tr><td style="width:150px;">Naziv PDF-a EN: </td><td><input name="pdf_ime_en" type="text" class="textfield" id="pdf_ime_en" /></td></tr> <tr><td style="width:150px;">Odaberi pdf za upload:</td><td><input name="upfile" type="file" size="36"></td></tr> <tr><td style="width:150px;"></td><td align="lef"><br/><input type="submit" name="Submit" id="Submit" value="Pošalji" /></td></tr> </table></center> </form> <?php $novost_id = $_GET['novost_id']; if (isset($_POST['Submit'])){ $pdf_ime_hr = $_POST['pdf_ime_hr']; if ($pdf_ime_hr == '') { echo "Niste upisali naziv PDF-a"; } else { ?> <div id="result"> <table width="100%"> <?php function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } $pdf_naziv = stripslashes($_FILES['upfile']['name']); $extension = getExtension($pdf_naziv); $extension = strtolower($extension); $ran_name = rand () ; $pdf_naziv = 'kus'.$ran_name.'.'.$extension; $allowed = array('pdf'); $uploadLocation = "../pdf/$pdf_naziv"; if(in_array($extension, $allowed)) { if(move_uploaded_file($_FILES['upfile']['tmp_name'], $uploadLocation)) { $pdf_ime_hr = $_POST['pdf_ime_hr']; $pdf_ime_en = $_POST['pdf_ime_en']; echo " <table width='400px' align='center' cellspacing='0'> <tr bgcolor='#E6e6e6' height='26'> <td align='center' width='100%' colspan='2'><strong>Potvrda</strong></td> </tr> <tr bgcolor='#F6f6f6'> <td align='center' style='border-left:#E6e6e6 1px solid;border-bottom:#E6e6e6 1px solid;'><img src='images/valid.png'></td> <td align='center' width='80'% style='border-right:#E6e6e6 1px solid;border-bottom:#E6e6e6 1px solid;'><strong>".$pdf_naziv." uspješno unesen.</strong></td> </tr> </table><br />"; mysql_query("INSERT INTO pdf SET pdf_naziv='$pdf_naziv', pdf_ime_hr='$pdf_ime_hr', pdf_ime_en='$pdf_ime_en', pdf_novost='$novost_id'"); } else{ echo " <table width='400px' align='center' cellspacing='0'> <tr bgcolor='#E6e6e6' height='26'> <td align='center' width='100%' colspan='2'><strong>Potvrda</strong></td> </tr> <tr bgcolor='#F6f6f6'> <td align='center' style='border-left:#E6e6e6 1px solid;border-bottom:#E6e6e6 1px solid;'><img src='images/warning.png'></td> <td align='center' width='80'% style='border-right:#E6e6e6 1px solid;border-bottom:#E6e6e6 1px solid;'><strong>PDF nije unesen.</strong></td> </tr> </table><br />";; } } else { echo "Pokušali ste uploadati datoteku koja nije PDF"; } ?> </table> </div> <?php } } ?> 2. Is it posible to add on page script that change desktop background. Exapmle i have 3 pictures for wall paper and user choose wich to put as desktop background? Link to comment https://forums.phpfreaks.com/topic/255273-questions/ Share on other sites More sharing options...
trq Posted January 18, 2012 Share Posted January 18, 2012 1. That completely depends on your hosting. 2. that has nothing at all to do with php. Link to comment https://forums.phpfreaks.com/topic/255273-questions/#findComment-1308815 Share on other sites More sharing options...
regoch Posted January 18, 2012 Author Share Posted January 18, 2012 1. That completely depends on your hosting. 2. that has nothing at all to do with php. 1. So I have to ask my hosting? 2. You think javascript or jquery? Link to comment https://forums.phpfreaks.com/topic/255273-questions/#findComment-1308822 Share on other sites More sharing options...
trq Posted January 18, 2012 Share Posted January 18, 2012 1. Yes, check with your hosting. 2. A user needs to add an image themselves. Link to comment https://forums.phpfreaks.com/topic/255273-questions/#findComment-1308824 Share on other sites More sharing options...
regoch Posted January 18, 2012 Author Share Posted January 18, 2012 1. Yes, check with your hosting. 2. A user needs to add an image themselves. Thanks! Link to comment https://forums.phpfreaks.com/topic/255273-questions/#findComment-1308828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.