Search open save PDF File using PHP

Reply

Join Date: Jun 2009
Posts: 197
Reputation: ayesha789 is an unknown quantity at this point 
Solved Threads: 3
ayesha789's Avatar
ayesha789 ayesha789 is offline Offline
Junior Poster

Search open save PDF File using PHP

 
1
  #1
Oct 7th, 2009
Hi
Please tell me how we can search PDF File , which is stored in folder
like C:\Folder
and then show in
show.php page as dynamic link.

also Upload new PDF File to Folder

Please tell me how?
Ayesha
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 525
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 61
network18 network18 is offline Offline
Posting Pro
 
0
  #2
Oct 7th, 2009
why you want to search for the pdf file through php, if you know the path and the file name both?
If you have both, you can simply get it as like other files using fopen etc
Reply With Quote Quick reply to this message  
Join Date: Sep 2009
Posts: 525
Reputation: network18 is an unknown quantity at this point 
Solved Threads: 61
network18 network18 is offline Offline
Posting Pro
 
0
  #3
Oct 7th, 2009
why you want to search for the pdf file through php, if you know the path and the file name both?
If you have both, you can simply get it as like other files using fopen etc
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 197
Reputation: ayesha789 is an unknown quantity at this point 
Solved Threads: 3
ayesha789's Avatar
ayesha789 ayesha789 is offline Offline
Junior Poster
 
0
  #4
Oct 8th, 2009
please guide me
Ayesha
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,612
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 467
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven
 
0
  #5
Oct 8th, 2009
Use directory functions - http://us2.php.net/manual/en/function.readdir.php

  1. <?php
  2. $dirsource = "D:/files/images";
  3. $dirdest = "D:/files/dest";
  4.  
  5. recursive_copy($dirsource, $dirdest);
  6.  
  7. function recursive_copy($dirsource, $dirdest) {
  8. // recursive function to copy all subdirectories and contents:
  9. if(is_dir($dirsource))$dir_handle=opendir($dirsource);
  10. $dirname = substr($dirsource,strrpos($dirsource,"/")+1);
  11.  
  12. mkdir($dirdest."/".$dirname, 0750);
  13. while($file=readdir($dir_handle))
  14. {
  15. if($file!="." && $file!="..")
  16. {
  17. if(!is_dir($dirsource."/".$file)) copy ($dirsource."/".$file, $dirdest."/".$dirname."/".$file);
  18. else
  19. {
  20. $dirdest1 = $dirdest."/".$dirname;
  21. recursive_copy($dirsource."/".$file, $dirdest1);
  22. }
  23. }
  24. }
  25. closedir($dir_handle);
  26. return true;
  27. }
  28. echo "dir copy";
  29. die;
  30.  
  31. $dirsource = "D:/files/test";
  32. $dirdest = "D:/files/test1";
  33. recursive_move($dirsource, $dirdest);
  34.  
  35. function recursive_move($dirsource, $dirdest)
  36. { // recursive function to copy all subdirectories and contents:
  37. if(is_dir($dirsource))$dir_handle=opendir($dirsource);
  38. $dirname = substr($dirsource,strrpos($dirsource,"/")+1);
  39.  
  40. mkdir($dirdest."/".$dirname, 0750);
  41. while($file=readdir($dir_handle))
  42. {
  43. if($file!="." && $file!="..")
  44. {
  45. if(!is_dir($dirsource."/".$file))
  46. {
  47. copy ($dirsource."/".$file, $dirdest."/".$dirname."/".$file);
  48. unlink($dirsource."/".$file);
  49. }
  50. else
  51. {
  52. $dirdest1 = $dirdest."/".$dirname;
  53. recursive_move($dirsource."/".$file, $dirdest1);
  54. }
  55. }
  56. }
  57. closedir($dir_handle);
  58. rmdir($dirsource);
  59. }
  60. ?>
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Reply

Tags
pdf, search, searchbox, upload

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC