why can not download it?
why can not download it?
Is it possible to use the API to change the error pages?
The error pages are just .shtml files in the user's directory. If you want to have default error pages, just place them in your skeleton directory and they'll be placed in all new accounts. If you want something dynamic (e.g. showing the domain name), you could use .php files instead and include a .htaccess file that instructs Apache to use those files instead.
However, the API1 code for editing a file is:
dir is the directory where the file should be stored (starting at the user's home directory)Code:<cpanel Fileman="fmsavefile($FORM{'dir'},$FORM{'file'},$FORM{'page'})">
file is the name of the actual file.
page is the actual contents of the .shtml file to be saved.
Weird, I dont get an error when I try it, but it doesnt work
PHP Code:<?php
$dir = '/public_html';
$file = 'test.htm';
$page = 'test';
print $xmlapi->api1_query($cpanel_un, 'Fileman', 'fmsavefile', array($dir, $file, $page));
?>See how the data and result is empty? weird<?xml version="1.0" ?>
<cpanelresult>
<module>Fileman</module>
<func>fmsavefile</func>
<type>event</type>
<source>internal</source>
<apiversion>1</apiversion>
<data>
<result></result>
</data>
</cpanelresult>
Correct, there is no output from this function. However, the data is saved in my tests with no entries to the error_log (which is good).
Here's the output I get:
[HTML]<cpanelresult>
<module>Fileman</module>
<func>fmsavefile</func>
<type>event</type>
<source>internal</source>
<apiversion>1</apiversion>
−
<data>
<result/>
</data>
</cpanelresult>[/HTML]
Can you tell me your code? I tried a few things, nothing works, and no error_log entries
This time it threw an error..
<?xml version="1.0" ?>
<cpanelresult>
<module>Fileman</module>
<func>fmsavefile</func>
<type>event</type>
<source>internal</source>
<apiversion>1</apiversion>
<data><result>
<fatalerror>[a fatal error or timeout occurred while processing this directive]</fatalerror>
Last edited by jhyland87; 06-06-2009 at 07:02 PM.
Here's the URL I was using in my testing:
https://SERVER:2083/xml-api/cpanel?xmlin=<cpanelaction><module>Fileman</module><func>fmsavefile</func><apiversion>1</apiversion><args>/public_html</args><args>test.txt</args><args>file%20contents</args></cpanelaction>
Still tinkering with it, not sure what im doing wrong
I see in the form action it has
But that doesnt seem to be used in the fmsavefile function, just in the links on the savefile.html..PHP Code:<input type="hidden" name="domain" value="<cpanel print="$FORM{'domain'}">">
Last edited by jhyland87; 06-08-2009 at 03:35 PM.
I DID get it, cant seem to get it again.. weird.
Thats what it spits out, if that helps, doubt it though<cpanelresult>
<module>Fileman</module>
<func>fmsavefile</func>
<type>event</type>
<source>internal</source>
<apiversion>1</apiversion>
<data><result></result></data>
</cpanelresult>