FileSystem->CreateTextFile will not create a file

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

Pater

FileSystem->CreateTextFile will not create a file

Post by Pater »

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?
Pater
Posts: 15
Joined: Fri Jun 03, 2011 12:45 pm

Re: FileSystem->CreateTextFile will not create a file

Post by Pater »

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
Post Reply