06-10-2011, 04:20 AM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jun 2011
Device: none
|
Folder not valid
Hello everybody,
I'm trying to build a simple tool in PHP to automatically convert eBooks from PDF to HTMLZ (I need to do some processing afterwards, so I need HTMLZ). But I get the following error from ebook-convert.exe: Code:
Python function terminated unexpectedly Folder not valid (Error Code: 1) Traceback (most recent call last): File "site.py", line 103, in main File "site.py", line 84, in run_entry_point File "site-packages\calibre\__init__.py", line 15, in <module> File "site-packages\calibre\constants.py", line 126, in <module> ValueError: Folder not valid Code:
"C:\Program Files (x86)\Calibre2\ebook-convert.exe" C:\inetpub\wwwroot\epubgenerator\work\Pink_Cover039.pdf C:\inetpub\wwwroot\epubgenerator\work\Pink_Cover039.htmlz > error 2>&1 When I copy the command to the cli, it works perfectly . Does anybody what can be wrong? I've checked the permissions on the file Pink_cover039.pdf and Everyone has all permissions, so that can't be the problem. |
06-10-2011, 05:11 AM | #2 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
It is probably the backslashes. Backslash is the escape character in PHP (as it is in most languages). PHP is trying to convert \e and the like to their escaped equivalents.
Either double the backslashes (so they escape themselves) or convert them to front slashes. |
Advert | |
|
06-10-2011, 06:19 AM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jun 2011
Device: none
|
Hi Chaley,
I've tried changing the \ to /, but it had no effect. The same error popped up . |
06-10-2011, 06:33 AM | #4 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Looking at the python code throwing the error, it has to do with finding your calibre configuration directory. I have no idea how php interacts with windows concerning environment vars and the like.
Second-to-last suggestion: write your script in python instead of PHP. Last suggestion: put your command into a .bat file and have your PHP code exec the bat file. That gives you something to debug, as you can see and set environment variables before calling ebook-convert.exe. Good luck! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
EPub is not valid | samuel17 | ePub | 10 | 01-30-2011 07:55 PM |
Valid ePub, but not valid enough for iBooks | MichaelGray | ePub | 46 | 01-14-2011 08:22 AM |
sub-folder support for documents folder? | sark666 | Kobo Reader | 5 | 08-31-2010 05:35 AM |
With a valid CC and U.S. Address..... | clobber | Sony Reader | 2 | 12-05-2008 10:04 AM |
This book is not valid! | James Bryant | Bookeen | 8 | 06-20-2008 11:09 PM |