n8n Advanced Course (7/8) - Handling files
6:41

n8n Advanced Course (7/8) - Handling files

n8n 20.06.2024 60 174 просмотров 615 лайков

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI
Описание видео
⌨ Sign up to n8n Cloud for a free trial: https://app.n8n.cloud/register Or: npm install -g n8n n8n start *Resources:* ❔ Need help or want to discuss the course? Join the conversation on our forum: https://community.n8n.io/t/advanced-course-7-8-handling-files/48602 🛠 Workflow templates: https://n8n.io/workflows/ 📚 Documentation: https://docs.n8n.io/

Оглавление (3 сегментов)

Introduction

hey and welcome to video number seven of the advanced course for NN this video will cover handling files which is quite an advanced feature ofn workflow

Binary View

building when dealing with files the node output will have a new Option uh called binary view um alongside Json table and schema when reading images or documents the binary data will let you preview or download those files directly onto your computer all of this will help with well handling files the binary output will give you additional information about the file name directory file type size Etc when dealing only with files the table Json and schema views will be empty here you see an example of a binary view I made an H HTTP request to retrieve a file and here I have different information about that file name directory extension size Etc by clicking on The View I able to preview this file but I could also download it onto my machine um so I can view it directly here for an SVG format we can obviously preview the

Handling files

image when dealing with files so what are the key nodes that we're going to be able to use when handling files all the nodes related to handling files are in the file category some of the useful nodes will help you with compressing or decompressing files uh using the zip format you're likely familiar with um will allow you to read or write files from the disk Um this can be particularly useful if you're self hosting and then or converting Json objects into or from the file format to illustrate how we can use files in nen I have a HTTP request node here that is making a get HTTP request to nn. logo and uh here we can see the expected response format is a file going put it in a f in a field called logo when I execute here um the first thing we're going to see is the uh binary view which lets us uh preview but also download the image and the table and Json and schema views are going to be completely empty if uh back and behind this node I drag another HTTP request this time I'm just um same process just looking for a different kind of file and I execute here we can see that binary items um behave a bit differently than regular items and append uh each other so in the previous execution we only had logo and now we have logo and workflow image now that we have these two files um if I want to for example store them on my dis or if I want to compress them to be able to send them I can use the compress files obviously the operation is going to be compressed but we can use the same node to decompress files and I can just add here the names logo and workflow set the output format as a zip give it a name compress. zip for example and when I execute the node we go from two files down into a single file that I can download to um test now that we've looked at how uh we can get multiple files with an HTTP request and compress them into a single zip file we can look at the opposite example and request a zip file decompressing the data and splitting it up the first thing we need to do obviously is get the uh file so here we have the same as last time a get HTTP request that goes and gets a zip file on a server by executing here once again we see table and Json are empty and we have a binary file that we can Again download here using the uh decompress node here we can um extract all of the different files that are in data uh here we can see that we have three different files file zero file one and file two that are an unsplash image a second unsplash image and a third one again all of the information about the file can be found here apparently we have three jpegs The Next Step here is going to be to split this out as you can see we only have one item so if in um the next part of the workflow we're going to want to deal with these different images separately we're going to have to split out this single item into different binary items for this uh we can use the code node um this is something that you can find in the templates that will allow you to Simply take these binary files and split them out so when I execute the node here we see that we have this time three different binary items um all named data and that correspond to the three files that we saw earlier this time split out here we can again see we have a single item here and then we have three items here so following on we can now build our workflow um looping through all of these different items thanks for listening to the seventh video of the in Advanced course where we covered handling files in the next video we'll cover some Enterprise features that'll take your workflow building to the next level

Другие видео автора — n8n

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник