# Create service that returns the content of a file using an URL

**URL:** <https://community.dreamfactory.com/t/create-service-that-returns-the-content-of-a-file-using-an-url/4747>\
**Category:** REST API\
**Created:** [December 18, 2018, 2:04pm UTC](https://community.dreamfactory.com/t/create-service-that-returns-the-content-of-a-file-using-an-url/4747 "2018-12-18T14:04:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fwu](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@fwu](https://community.dreamfactory.com/u/fwu)\
**Post date:** [December 18, 2018, 2:04pm UTC](https://community.dreamfactory.com/t/create-service-that-returns-the-content-of-a-file-using-an-url/4747/1 "2018-12-18T14:04:28Z")

</div>

hello,

I have an app that is getting the contents (xml) of a file using a http link. I would like to replace the direct call for that link with a rest call using dreamfactory that would get that file content and send it to the client.

Basically, the client will send this info: client\_name; server; key (dreamfactory key)  
With this info, I need dreamfactory to get the file using the following link:  
[https://server/client\_name.jsp](https://server/client_name.jsp) and then returns the content of that jsp (which is xml).

What is the best approach to achieve this using dreamfactory?

thank you

---

<div class="post-metadata">

**Author:** ![Hussain\_Fakhruddin](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/hussain_fakhruddin/32/935_2.png) [@Hussain\_Fakhruddin](https://community.dreamfactory.com/u/Hussain_Fakhruddin)\
**Post date:** [January 2, 2019, 4:29am UTC](https://community.dreamfactory.com/t/create-service-that-returns-the-content-of-a-file-using-an-url/4747/2 "2019-01-02T04:29:34Z")

</div>

Write a custom php script inside DF , modify the content type header to application/xml  
inside the script you can write anything like curl or file\_get\_contents etc.
