# ifile creation

**URL:** <https://community.f5.com/t/ifile-creation/51790>\
**Category:** Technical Forums\
**Tags:** tmsh, irules, devops, application-delivery, ltm\
**Created:** [May 4, 2020, 4:49pm UTC](https://community.f5.com/t/ifile-creation/51790 "2020-05-04T16:49:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shashank\_jain](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@Shashank\_jain](https://community.f5.com/u/Shashank_jain)\
**Post date:** [May 4, 2020, 4:49pm UTC](https://community.f5.com/t/ifile-creation/51790/1 "2020-05-04T16:49:21Z")

</div>

Hi All,

i am trying to create an iFile with below curl command ,

curl -k -u username:password -H “Content-Type: application/json” -X POST -d ‘{“source”:“/var/tmp/404.html”,“datastore”:“ifile”,“state”:“present”,“force”:“yes”}’ [https://hostname/mgmt/tm/sys/file/ifile/~Common~404.html](https://hostname/mgmt/tm/sys/file/ifile/~Common~404.html)

and getting “{“code”:400,“message”:“enter ifile identifier”,“errorStack”:[],“apiError”:26214401}” in exception .

can someone help me what i am missing in this request ?

Also how would i able to make this iFile available to LTM once this is created for use .

basically i am looking for rest API of below two tmsh command

# tmsh create sys file ifile maintenance-splash-page.html source-path file:/var/tmp/splash-page.html

# tmsh create ltm ifile maintenance-splash-page.html file-name maintenance-splash-page.html

---

<div class="post-metadata">

**Author:** ![Samir](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/samir/32/13073_2.png) [@Samir](https://community.f5.com/u/Samir)\
**Post date:** [May 5, 2020, 3:00pm UTC](https://community.f5.com/t/ifile-creation/51790/2 "2020-05-05T15:00:09Z")

</div>

you can try something like this.

curl -v -k -u admin:admin -X POST -H “Content-Type: application/json” -d ‘{“name”:“404.html”, “file-name”: “/var/tmp/404.html”}’ [https://bigip](https://bigip)\_host/mgmt/tm/ltm/ifile/404.html
