# ifile default location of imported files

**URL:** <https://community.f5.com/t/ifile-default-location-of-imported-files/3135>\
**Category:** Technical Forums\
**Tags:** tmsh, irules, application-delivery\
**Created:** [September 8, 2016, 9:51am UTC](https://community.f5.com/t/ifile-default-location-of-imported-files/3135 "2016-09-08T09:51:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Basil\_Parsley\_1](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@Basil\_Parsley\_1](https://community.f5.com/u/Basil_Parsley_1)\
**Post date:** [September 8, 2016, 9:51am UTC](https://community.f5.com/t/ifile-default-location-of-imported-files/3135/1 "2016-09-08T09:51:26Z")

</div>

Guys simple one - what is the default location of “ifile” files on an LTM when uploaded via the GUI under

system … File man .. iFile list … Import

Basically I just need to pull HTML files off the device edit and re-upload. Happy to take any additional relevant advice / input…

---

<div class="post-metadata">

**Author:** ![Kai\_Wilke](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kai_wilke/32/24646_2.png) [@Kai\_Wilke](https://community.f5.com/u/Kai_Wilke)\
**Post date:** [September 8, 2016, 11:50am UTC](https://community.f5.com/t/ifile-default-location-of-imported-files/3135/2 "2016-09-08T11:50:26Z")

</div>

Hi Basil,

you can lookup the iFile location on your harddisks by using the command below…

```tcl
[itacs@f5-test:Active:Standalone] ~ find / -name "*MyiFileName*"

```

But its not possible to change the iFile in the background, since they are referenced within your configuration using a version number including a MD5 hash. If you try to change them directly you will most likely destroy the iFiles on the next configuration load.

I would recommend to export all your iFiles from the device (via SCP). Edit them as needed. Rename them 1:1 to match the name of the iFile file object and upload every ifile back to e.g.

```tcl
/ifiles/*

```

.

The use a TMSH script to enumerate every iFile file object and update every single iFile configuration using the

```tcl
source-path file:/ifiles/$ifile_name

```

option.

You may use the script below as a starting point…

_ **update\_ifiles.tcl** _

```tcl
proc script::run {} {
    foreach ifile [tmsh::get_config /sys file ifile] {
        set ifile_name [tmsh::get_name $ifile]
        if { [catch {
            eval "tmsh::modify /sys file ifile $ifile_name \{ source-path file:/ifiles/$ifile_name \}"
            puts "iFile Update: Successfully updated iFile : $ifile_name"
        }] } then {
            puts "iFile Update: Failed to update iFile : $ifile_name"
        }
    }   
}

```

_ **TMSH script execution** _

```tcl
[itacs@f5-02:Active:Standalone] / tmsh run cli script file /script_path/update_ifiles.tcl 
iFile Update: Successfully updated iFile : MyiFile
iFile Update: Successfully updated iFile : iFileTest
curl: (37) Couldn't open file :/ifiles/iFileTest2

iFile Update: Failed to update iFile : iFileTest2

```

_ **Note:** If a given iFile is not found within the /ifiles/ directory its getting ignored. So you could also export/change/modify just a subset of your iFiles…_

Cheers, Kai
