Open URL - Set File Name

Oxygen general issues.
jon
Posts: 7
Joined: Thu Mar 06, 2014 9:14 pm

Open URL - Set File Name

Post by jon »

Hi everyone,

I have a PHP script that generates a DITA file from an HTML page using the PHP transformToXml() method. Then when I want to open the resulting DITA file via its URL, oXygen will set the file name to the PHP script automatically.

Here is the URL I am using (changed for privacy): http://www.mysite.com/php/my_script.php?url=my_url
The loaded file name will automatically be my_script.php, eventhough it's an XML file (I have set its mime-type to application/xml).

I was wondering if there was any way of changing that.
Best regards,
Jonathan
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Open URL - Set File Name

Post by adrian »

Hi Jonathan,

By default Oxygen ignores the mime-type, but there's an option you can enable in:
Options > Preferences, Connection settings > HTTP(S)/WebDAV
If you enable Use the 'Content-Type' header field to determine the content type, it will recognize the mime-type and open it as expected (as an XML file).
Note that the name will still be that of the script, but the content will be handled correctly.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
jon
Posts: 7
Joined: Thu Mar 06, 2014 9:14 pm

Re: Open URL - Set File Name

Post by jon »

Thanks Adrian.
I wasn't clear enough, the content is handled correctly (eventhough I hadn't enabled the option you mentioned), but it's really just the file name I wanted to change (like, even call it "untitled" or any default name).
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Open URL - Set File Name

Post by adrian »

Hi,

Unfortunately there is no 'by design' way to do this from the Oxygen side. You could probably do something on the server side or maybe within the script.

However, you could trick Oxygen to believe it's a folder URL if you end the URL with '/' and then it will provide an 'untitled' name.
e.g. add at the end of the URL a dummy parameter that has the value '/'

Code: Select all

http://www.mysite.com/php/my_script.php?url=my_url&dummy=/
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply