944,033 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 3984
  • PHP RSS
Oct 7th, 2009
0

Search open save PDF File using PHP

Expand Post »
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?
Similar Threads
Reputation Points: 17
Solved Threads: 6
Posting Pro in Training
ayesha789 is offline Offline
485 posts
since Jun 2009
Oct 7th, 2009
0
Re: Search open save PDF File using PHP
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
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Oct 7th, 2009
0
Re: Search open save PDF File using PHP
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
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Oct 8th, 2009
0
Re: Search open save PDF File using PHP
please guide me
Reputation Points: 17
Solved Threads: 6
Posting Pro in Training
ayesha789 is offline Offline
485 posts
since Jun 2009
Oct 8th, 2009
0
Re: Search open save PDF File using PHP
Use directory functions - http://us2.php.net/manual/en/function.readdir.php

PHP Syntax (Toggle Plain Text)
  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. ?>
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: friendster
Next Thread in PHP Forum Timeline: header file





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC