FileSystem->CreateTextFile will not create a file

Post a reply

Visual Confirmation

To prevent automated access and spam, you are required to confirm that you are human. Please place a check mark next to all images of monkeys or apes. If you cannot see any images, please contact the Board Administrator.

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: FileSystem->CreateTextFile will not create a file

Re: FileSystem->CreateTextFile will not create a file

Post by Pater » Fri Jun 03, 2011 1:22 pm

Found the solution myself

Code: Select all
$file = $this->objSDB->FileSystem->CreateTextFile("C:\xampp\htdocs\KeldertjeUpload\test.jpg");

Using the above code with double quotes will not work. Use single qoutes instead. This is also the case for other FileSystem methods

FileSystem->CreateTextFile will not create a file

Post by Pater » Fri Jun 03, 2011 12:26 pm

Hi

Im making a custom PHP+AJAX interface for mediamonkey. The current functionality i'm working on
is having the albumart of the current song shown in the interface.

However: the following won't work:
Code: Select all
<?php
function createImageFile( $ImageData, $ImageDataLen)
   {
      $file = $this->objSDB->FileSystem->CreateTextFile("C:\xampp\htdocs\KeldertjeUpload\test.jpg");
      $this->objSDB->FileSystem->FileExists( "C:\xampp\htdocs\KeldertjeUpload\upload.php" ) ? print "true" : print "False";
      print gettype( $file );
      $file->WriteData( $ImageData, $ImageDataLen );
   }
?>


it gives me the following output:
Code: Select all
fileexists: False
gettype: NULL
Fatal error: Call to a member function WriteData() on a non-object in C:\xampp\htdocs\KeldertjeUpload\classes\tools.php on line 19


and the file is not created. I figured it was a permission problem, but i gave the account that runs mediamonkey writing permission for the folder, and it still won't work.

Anyone got an idea whats the problem or how i could get some debugging going?

Top