# InsertFromURL PUSH FTP

**URL:** <https://the.fmsoup.org/t/insertfromurl-push-ftp/4137>\
**Category:** Questions\
**Tags:** filemaker\
**Created:** [June 1, 2024, 11:33pm UTC](https://the.fmsoup.org/t/insertfromurl-push-ftp/4137 "2024-06-01T23:33:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![barefoot](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/barefoot/32/2553_2.png) [@barefoot](https://the.fmsoup.org/u/barefoot)\
**Post date:** [June 1, 2024, 11:33pm UTC](https://the.fmsoup.org/t/insertfromurl-push-ftp/4137/1 "2024-06-01T23:33:49Z")

</div>

Is there an example how to specify an InsertFromURL call to succeed connecting to an FTP server and uploading a file to a directory (so that it works)? And of course the cURL options!!!

Assuming you have the ftp server's URL and you have an account to acceess and you have a file in a container field. Somehow I cannot find any instructions how to conduct this successfully!

---

<div class="post-metadata">

**Author:** ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)\
**Post date:** [June 3, 2024, 1:06am UTC](https://the.fmsoup.org/t/insertfromurl-push-ftp/4137/2 "2024-06-03T01:06:05Z")

</div>

I've done it. I think you should be able to find the info you need here: [Claris Community (English)](https://community.claris.com/en/s/question/0D50H00006jI2OFSA0/how-do-i-to-upload-file-via-curl-from-filemaker)

## tl;dr

**$curl**

```auto
--upload-file $file --user "<USERNAME>:<PASSWORD>"

```

**$url**

```auto
ftp://my.server.com/my-cool-file.txt

```

**$file (can be text or container data)**

```auto
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non nibh at neque vehicula accumsan quis hendrerit ligula. Integer vestibulum justo dolor, sit amet maximus mi euismod sed.

```

**FM Script**

```auto
Insert From URL [Target: $result ; $url ; cURL options: $curl]

```

## Full Example

```auto
# Plop container field data into a var so it's plopped and ready to go.
Set Variable [$file ; Value: Table::container_to_upload] 
# Then reference the var *name* in the curl calc (don't substitute it in).
Set Variable [$curl ; Value: "--upload-file $file --user \"josh:josh\" --dump-header $response_headers --trace-ascii $trace"] 
# ftp server running on localhost for testing.
# Picking a random uuid filename for this example:
Set Variable [$url ; Value: "ftp://localhost/uploads/" & Get ( UUID ) & ".png"] 
Insert from URL [Select ; With dialog: Off ; Target: $response_body ; $url ; cURL options: $curl] 

# Store result (body probably empty, and the headers/trace optional)
Set Field [Table::response_body ; $response_body] 
Set Field [Table::response_headers ; $response_headers] 
Set Field [Table::trace ; $trace] 
Commit Records/Requests [With dialog: Off] 

```

---

<div class="post-metadata">

**Author:** ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)\
**Post date:** [June 3, 2024, 4:26am UTC](https://the.fmsoup.org/t/insertfromurl-push-ftp/4137/3 "2024-06-03T04:26:14Z")

</div>

Anyone have a SFTP version?

---

<div class="post-metadata">

**Author:** ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)\
**Post date:** [June 3, 2024, 4:47am UTC](https://the.fmsoup.org/t/insertfromurl-push-ftp/4137/4 "2024-06-03T04:47:01Z")

</div>

I've gotten mixed messages about whether sftp works from FM. I'm assuming the above doesn't work for sftp:// for you then?

Mr camelCase said it works for him here: [Claris Community (English)](https://community.claris.com/en/s/question/0D53w000069ygfdCAA/sftp-with-insert-from-url-should-work-in-fm20)

---

<div class="post-metadata">

**Author:** ![Markus](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Markus](https://the.fmsoup.org/u/Markus)\
**Post date:** [June 3, 2024, 8:00am UTC](https://the.fmsoup.org/t/insertfromurl-push-ftp/4137/5 "2024-06-03T08:00:55Z")

</div>

he is also a member of the forums here: @CamelCase

---

<div class="post-metadata">

**Author:** ![barefoot](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/barefoot/32/2553_2.png) [@barefoot](https://the.fmsoup.org/u/barefoot)\
**Post date:** [June 3, 2024, 2:45pm UTC](https://the.fmsoup.org/t/insertfromurl-push-ftp/4137/6 "2024-06-03T14:45:17Z")

</div>

Thank you very much @jwilling !
