Author Message

Posted: Fri Aug 21, 2009 2:20 am   Post subject: SDK and mapped drives

When I run the sample php code EXACTLY as provided, it runs. I also changed the PPT_FILE string to an absolute path so I could run it from my web server folder instead of the SDK samples folder.

However, when I change the PPT_FILE path to a network mapped drive, in this case Y:, I get the following error:

Opening presentation
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> iSpring.PresentationConverter.4<br/><b>Description:</b> Presentation not found' in C:\wamp\www\ispring\test.php:12 Stack trace: #0 C:\wamp\www\ispring\test.php(12): com->OpenPresentation('Y:\ppt\dougw\Fu...') #1 {main} thrown in C:\wamp\www\ispring\test.php on line 12

I KNOW the path is correct.

Question:

Does iSpring SDK work with a mapped drive on a network?


Profile profile test

Posted: Fri Aug 21, 2009 11:11 am   Post subject: Re: SDK and mapped drives

I may quess that you might have forgotten that back slash character in PHP is an escape character and should be used twice:

Code:
$ppt->OpenPresentation("y:\\ppt\dougw\\...");


You can also use the "/" character in file path. In this case you don't need to double it:

Code:
$ppt->OpenPresentation("y:/ppt/doug/...");


I will be able to give you more precise answer if you show your source code.


Profile profile test WWW www ICQ ICQ

Posted: Fri Aug 21, 2009 12:02 pm   Post subject: Re: SDK and mapped drives

Thanks Aleksey.

Why would it work for C drive but not Y drive?

Anyway here is my code... Note commented out line that works at top...

Code:
<?php
   set_time_limit(0);

   //$PPT_FILE = "C:\\Program Files\\iSpring\\SDK\\samples\\server\\media\\presentations\\quicktour.ppt";
   $PPT_FILE = "Y:\\ppt\\dougw\\Funding.ppt";
   $SWF_FOLDER = "C:\\wamp\\www\\ispring";
   $SWF_FILE = "Funding.swf";

   $fs = new COM("iSpring.PresentationConverter");

   echo "Opening presentation\n";
   $fs->OpenPresentation($PPT_FILE);

   echo "Generating flash...\n";
   $fs->GenerateFlash($SWF_FOLDER, $SWF_FILE, 0, "Standard");

   echo "Done\n";

   // Warning! When you don't need iSpring object it is necessary to set it to null
   // otherwise error will occur when PHP script finishes.
   $fs = null;

?>


and then this as the error...

Opening presentation
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> iSpring.PresentationConverter.4<br/><b>Description:</b> Presentation not found' in C:\wamp\www\ispring\test.php:12 Stack trace: #0 C:\wamp\www\ispring\test.php(12): com->OpenPresentation('Y:\ppt\dougw\Fu...') #1 {main} thrown in C:\wamp\www\ispring\test.php on line 12


Profile profile test

Posted: Fri Aug 21, 2009 12:10 pm   Post subject: Re: SDK and mapped drives

I just found that if I use the network path instead of the 'mapped' drive letter it works just fine. So the SDK doe NOT work with mapped drives on a network. Interesting. You might make a note of this...

What does NOT work:

$PPT_FILE = "Y:\\filedir\\file.ppt

What DOES work:

$PPT_FILE = "\\\mynetdrive\mymappedpartition\\filedir\\file.ppt

Where \\mynetdrive\mymappedpartition is mapped to Y:

Thanks!


Profile profile test

Posted: Fri Aug 21, 2009 12:27 pm   Post subject: Re: SDK and mapped drives

Make sure that your PHP script have an access to the mapped network drive.

The following code works for me:

Code:
<?
   set_time_limit(0);


   $PPT_FILE = "x:\\presentation.pptx";
   
   $SWF_FOLDER = "";
   $SWF_FILE = "quicktour.swf";

   $fs = new COM("iSpring.PresentationConverter");

   echo "Opening presentation\n";
   $fs->OpenPresentation($PPT_FILE);

   echo "Generating flash...\n";
   $fs->GenerateFlash($SWF_FOLDER, $SWF_FILE, 0, "Standard");

   echo "Done\n";


   // Warning! When you don't need iSpring object it is necessary to set it to null
   // otherwise error will occur when PHP script finishes.
   $fs = null;

?>


where the X: drive is mapped to one of network folders.

Make sure that your PHP script is able to do file_get_contents() of the specified mapped network file.

I think that the problem is caused by the fact that the user account you use to launch your PHP script doesn't see the Y: drive at all.


Profile profile test WWW www ICQ ICQ

Posted: Fri Aug 21, 2009 2:00 pm   Post subject: Re: SDK and mapped drives

Good point. I noticed that the user that is used to create the output files is 'nobody' even though I have changed that in apache config. I'll look into it. Thank you!


Profile profile test
Display posts from previous:  Sort by  

  


Who is online
Who is online In total there are 6 users online :: 1 registered, 0 hidden and 5 guests (based on users active over the past 5 minutes)
Most users ever online was 108 on Thu Nov 21, 2013 3:41 pm

Registered users: Bing [Bot]


cron