# Saving / exporting file from web visualization (webvisu)

**URL:** <https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761>\
**Category:** CODESYS\
**Created:** [April 16, 2025, 10:20am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761 "2025-04-16T10:20:23Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [April 16, 2025, 10:20am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/1 "2025-04-16T10:20:23Z")

</div>

Is there a solution for viewing files and saving (exporting) to a PC files that are on a flash drive?  
I have a flash drive and it periodically writes files, I want through web visualization to see what are the files on the flash drive and selecting a certain save yourself.  
Previously, I did it via FTP (fileZilla).

---

<div class="post-metadata">

**Author:** ![AdamReeve](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/adamreeve/32/59_2.png) [@AdamReeve](https://www.wago.community/u/AdamReeve)\
**Post date:** [April 16, 2025, 5:05pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/2 "2025-04-16T17:05:45Z")

</div>

The VisuDialogs library has a “FileOpenSave” dialog that may be useful here, and also the Visu\_fbFileListProvider function block that works with it.

A few years ago, I created my own function similar to what you describe by using the WagoAppFileDir library and WagoAppFtp library, utilizing a made-from-scratch Visualization that employs tables to display the directory contents.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/7/75286be624b95719722170a4f1c799c2d5c86537.png)

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [April 17, 2025, 8:36am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/3 "2025-04-17T08:36:15Z")

</div>

I have two questions at once:

1. This can work on cockpit ?
2. “FileOpenSave” I found this elite in cockpit, I didn’t find the bibilio with Visu\_fbFileListProvider.

---

<div class="post-metadata">

**Author:** ![AdamReeve](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/adamreeve/32/59_2.png) [@AdamReeve](https://www.wago.community/u/AdamReeve)\
**Post date:** [April 17, 2025, 2:25pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/4 "2025-04-17T14:25:39Z")

</div>

Yes, I found it in my e!Cockpit installation. Be sure to click “Advanced” at the bottom of the Add Library dialog before you do your search for VisuDialogs.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/4/4d5f9d5ddfe3d8361a4488f9f64e8f1fa57247ec.png)

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [April 18, 2025, 3:11pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/5 "2025-04-18T15:11:55Z")

</div>

Thanks, I’ve almost figured out how to do it. I’ll write later about the result.

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [April 25, 2025, 2:52pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/6 "2025-04-25T14:52:25Z")

</div>

I ran into the problem that I can’t unload the file.

 ![2025-04-25_17-48-15](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/a/a8931fc90ff22874fb91f608531f72fd0ae25e43.png)  
Using File Transfer, nothing happens when pressing.  
File (s) are stored on the SD card.  
spathtofile: = ‘/Media/sd/csv\_files/2024-07-01-01-13\_07\_23\_save\_dp.csv’  
Tell me the right path? Why doesn’t it save the file?

---

<div class="post-metadata">

**Author:** ![AdamReeve](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/adamreeve/32/59_2.png) [@AdamReeve](https://www.wago.community/u/AdamReeve)\
**Post date:** [April 25, 2025, 7:02pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/7 "2025-04-25T19:02:27Z")

</div>

I’ve never tried that File Transfer function. I suggest having your visu button trigger a function block from the WagoAppFtp library instead.

---

<div class="post-metadata">

**Author:** ![WagoIcard](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagoicard/32/1508_2.png) [@WagoIcard](https://www.wago.community/u/WagoIcard)\
**Post date:** [April 28, 2025, 12:38am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/8 "2025-04-28T00:38:30Z")

</div>

Hello,  
You are missing so much things to have it work.  
Please check this export part of a project I made:  
[VisuFileTransfert.export.txt](https://www.wago.community/uploads/short-url/uKd8Ge7J0KLFWLK894DVxO0UTYG.txt) (555.1 KB)  
Ps remove the .txt and do an import in e!Cockpit.

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [April 28, 2025, 10:43am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/9 "2025-04-28T10:43:01Z")

</div>

I am using Cockpit to check the solution, will it be possible to do this? Or is this solution only for Codesys?

 ![2025-04-28_13-39-55](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/9/997baa48d1f9198346c6901efdb8ef65fb2960d3.png)

---

<div class="post-metadata">

**Author:** ![WagoIcard](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagoicard/32/1508_2.png) [@WagoIcard](https://www.wago.community/u/WagoIcard)\
**Post date:** [April 28, 2025, 12:46pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/10 "2025-04-28T12:46:37Z")

</div>

So you will need the SysFile lib. and the other missing function are just function which convert a REAL to a String with “n” number after the “.”  
Sorry I’ve exported the function from my e!Cockpit project without looking is some function where used.

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [May 12, 2025, 10:13am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/11 "2025-05-12T10:13:56Z")

</div>

I’m having a problem with some of the functions:  
TO\_NSTRING and FuFileRename

 ![2025-05-12_13-24-26](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/3/3056a2a44f4991cddee1d7403e6294177b7b3351.png)

---

<div class="post-metadata">

**Author:** ![WagoIcard](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagoicard/32/1508_2.png) [@WagoIcard](https://www.wago.community/u/WagoIcard)\
**Post date:** [May 13, 2025, 6:05am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/12 "2025-05-13T06:05:24Z")

</div>

You are right, sorry I totally forgot about it:

```auto
FUNCTION TO_NSTRING : STRING
(* This function convert a LREAL into a STRING.*)
VAR_INPUT
	lrValue : LREAL;
	usiPres : USINT := 3;
END_VAR
VAR
	_lrValue	: LREAL;
	_uliHelp	: ULINT;
	_sHelp : STRING;
END_VAR

```

```auto
(* LIMIT usiPres between 0 and 7 *)
usiPres := LIMIT(0, usiPres, 7);
_lrValue := lrValue;
IF (_lrValue = 0) THEN
	_sHelp := '0';
	IF (usiPres > 0) THEN
		// _sHelp := Standard.CONCAT(_sHelp, '.');
		WagoAppString.StrAppend(sBuffer := _sHelp, udiSize := SIZEOF(_sHelp), sAppendee := '.');
		FOR _uliHelp := 1 TO usiPres BY 1 DO
			// _sHelp := Standard.CONCAT(_sHelp, '0');
			WagoAppString.StrAppend(sBuffer := _sHelp, udiSize := SIZEOF(_sHelp), sAppendee := '0');
		END_FOR;
	END_IF;
ELSE
	(* round the rVar to bPres digits *)
	_uliHelp := TO_ULINT(ABS(_lrValue) * EXP(usiPres * LN(10)));
	(* convert _uliHelp to string *)
	_sHelp := TO_STRING(_uliHelp);
	(* add missing "0"s *)
	WHILE (Standard.LEN(_sHelp) < usiPres) DO
		// _sHelp := Standard.CONCAT('0', _sHelp);
		WagoAppString.StrAppend(sBuffer := _sHelp, udiSize := SIZEOF(_sHelp), sAppendee := '0');
	END_WHILE
	(* add the separator *)
	IF (usiPres > 0) THEN
		//_sHelp := Standard.INSERT(_sHelp, '.', Standard.LEN(_sHelp) - bPres);
		WagoAppString.StrInsert(sBuffer := _sHelp, udiSize := SIZEOF(_sHelp), udiPos := TO_UDINT(Standard.LEN(_sHelp) - usiPres) + 1, sInsert := '.');
	END_IF;
	(* add leading 0 if needed *)
	IF (-1 < _lrValue) AND (_lrValue < 1) THEN
		// _sHelp := Standard.CONCAT('0', _sHelp);
		WagoAppString.StrAppend(sBuffer := _sHelp, udiSize := SIZEOF(_sHelp), sAppendee := '0');
	END_IF;
	(* add a minus sign if rVar is negative *)
	IF (_lrValue < 0) THEN
		// _sHelp := Standard.CONCAT('-', _sHelp);
		WagoAppString.StrAppend(sBuffer := _sHelp, udiSize := SIZEOF(_sHelp), sAppendee := '-');
	END_IF;
END_IF;
(* we copy the _sHelp in the output *)
TO_NSTRING := _sHelp;

```

```auto
FUNCTION FuFileRename : STRING
(*
	Extract a string which start after a '=' and end with a & or a 'CR' or 'LF' from a buffer;
*)
VAR_INPUT
	sFile : STRING;
	dtLastModification	: DT; // Time of last modification (in GMT, i.e. no timezone).
END_VAR
VAR
	_sFile : STRING;
	_sLastModification	: STRING;

	_iHelp : INT;
	_sHelp : STRING;
	
	_iExtention : INT;
	_sExtention : STRING;
END_VAR

```

```auto
// Init the String
_sFile := sFile;

// Remove the Path from the filename
_iHelp := Standard.FIND(_sFile, '/');
WHILE (_iHelp > 0) DO
	_sFile := Standard.RIGHT(_sFile, Standard.LEN(_sFile) - _iHelp);
	_iHelp := Standard.FIND(_sFile, '/');
END_WHILE;

// Find the file extention
_sExtention := _sFile;
_iHelp := Standard.FIND(_sExtention, '.');
WHILE (_iHelp > 0) DO
	_iExtention := _iHelp - 1;
	_sExtention := Standard.RIGHT(_sExtention, Standard.LEN(_sExtention) - _iHelp);
	_iHelp := Standard.FIND(_sExtention, '.');
END_WHILE;

IF (_iExtention > 0) THEN
	_sExtention := Standard.CONCAT('.', _sExtention);
	_iExtention := Standard.LEN(_sExtention);
ELSE
	_sExtention := '';
END_IF;

// Add '-'
_sFile := Standard.CONCAT(_sFile, '-');

// 'DATE_AND_TIME#1970-01-01-00:00:01' OR 'DT#1970-01-01-00:00:01'
_sLastModification := TO_STRING(dtLastModification);
// Remove the unused header '1970-01-01-00:00:01'
_sLastModification := Standard.RIGHT(_sLastModification, Standard.LEN(_sLastModification) - Standard.FIND(_sLastModification, '#'));

// Year
_sHelp := Standard.LEFT(_sLastModification, Standard.FIND(_sLastModification, '-'));
_iHelp := TO_INT(_sHelp);
IF (_iHelp < 10) THEN
	_sFile := Standard.CONCAT(_sFile, '000');
ELSIF (_iHelp < 100) THEN
	_sFile := Standard.CONCAT(_sFile, '00');
ELSIF (_iHelp < 1000) THEN
	_sFile := Standard.CONCAT(_sFile, '0');
END_IF;
_sFile := Standard.CONCAT(_sFile, TO_STRING(_iHelp));
// Remove the Year and the corresponding separator
_sLastModification := Standard.RIGHT(_sLastModification, Standard.LEN(_sLastModification) - Standard.FIND(_sLastModification, '-'));

// Month
_sHelp := Standard.LEFT(_sLastModification, Standard.FIND(_sLastModification, '-'));
_iHelp := TO_INT(_sHelp);
IF (_iHelp < 10) THEN
	_sFile := Standard.CONCAT(_sFile, '0');
END_IF;
_sFile := Standard.CONCAT(_sFile, TO_STRING(_iHelp));
// Remove the Month and the corresponding separator
_sLastModification := Standard.RIGHT(_sLastModification, Standard.LEN(_sLastModification) - Standard.FIND(_sLastModification, '-'));

// Day
_sHelp := Standard.LEFT(_sLastModification, Standard.FIND(_sLastModification, '-'));
_iHelp := TO_INT(_sHelp);
IF (_iHelp < 10) THEN
	_sFile := Standard.CONCAT(_sFile, '0');
END_IF;
_sFile := Standard.CONCAT(_sFile, TO_STRING(_iHelp));
// Remove the Day and the corresponding separator
_sLastModification := Standard.RIGHT(_sLastModification, Standard.LEN(_sLastModification) - Standard.FIND(_sLastModification, '-'));

// Add separator '-'
_sFile := Standard.CONCAT(_sFile, '-');

// Hour
_sHelp := Standard.LEFT(_sLastModification, Standard.FIND(_sLastModification, ':'));
_iHelp := TO_INT(_sHelp);
IF (_iHelp < 10) THEN
	_sFile := Standard.CONCAT(_sFile, '0');
END_IF;
_sFile := Standard.CONCAT(_sFile, TO_STRING(_iHelp));
// Remove the Hour and the corresponding separator
_sLastModification := Standard.RIGHT(_sLastModification, Standard.LEN(_sLastModification) - Standard.FIND(_sLastModification, ':'));

// Minute
_sHelp := Standard.LEFT(_sLastModification, Standard.FIND(_sLastModification, ':'));
_iHelp := TO_INT(_sHelp);
IF (_iHelp < 10) THEN
	_sFile := Standard.CONCAT(_sFile, '0');
END_IF;
_sFile := Standard.CONCAT(_sFile, TO_STRING(_iHelp));
// Remove the Minute and the corresponding separator
_sLastModification := Standard.RIGHT(_sLastModification, Standard.LEN(_sLastModification) - Standard.FIND(_sLastModification, ':'));

// Second
_sHelp := _sLastModification;
_iHelp := TO_INT(_sHelp);
IF (_iHelp < 10) THEN
	_sFile := Standard.CONCAT(_sFile, '0');
END_IF;
_sFile := Standard.CONCAT(_sFile, TO_STRING(_iHelp));

IF (_iExtention > 0) THEN
	// Add the file extention
	_sFile := Standard.CONCAT(_sFile, _sExtention);
END_IF;

// Output
FuFileRename := _sFile;

```

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [May 13, 2025, 8:08am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/13 "2025-05-13T08:08:16Z")

</div>

Thank you now the code compiles!  
There’s some kind of mistake. I don’t know where it came from.  
prgTransfer.\_iFileReadError = FILE\_TRANSFER\_SERVICES\_NOT\_SUPPORTED

 ![2025-05-13_11-05-55](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/0/0bfb282fcd169fc23ccebaf1a307b71fcd26df55.png)

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [May 13, 2025, 1:21pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/14 "2025-05-13T13:21:12Z")

</div>

The problem turns out to be more global.  
I made a project on codesys 3.5 SP19 P7. It turned out to have the same error (FILE\_TRANSFER\_SERVICES\_NOT\_SUPPORTED). So I need to somehow enable the transmission for the PLC? I have a 750-8212 FW28. Maybe I need to write some settings in the configuration file?

---

<div class="post-metadata">

**Author:** ![AdamReeve](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/adamreeve/32/59_2.png) [@AdamReeve](https://www.wago.community/u/AdamReeve)\
**Post date:** [May 13, 2025, 2:17pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/15 "2025-05-13T14:17:36Z")

</div>

Did you enable the FTP protocol from the Web-Based Management? It is disabled by default.

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [May 13, 2025, 2:30pm UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/16 "2025-05-13T14:30:37Z")

</div>

Of course it is enabled I log in via filezilla to view files.  
Right now my configuration is like this:

 ![2025-05-13_17-29-04](https://us1.discourse-cdn.com/flex016/uploads/wago/original/2X/0/0f63def7dce647a063a5c237403093d643048b8c.png)

---

<div class="post-metadata">

**Author:** ![WagoIcard](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagoicard/32/1508_2.png) [@WagoIcard](https://www.wago.community/u/WagoIcard)\
**Post date:** [May 16, 2025, 12:22am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/17 "2025-05-16T00:22:36Z")

</div>

Hello, The problem is not FTP or other but you have to modify a file in the PFC:  
In one of those files (depending on where the [CmpWebServerHandlerV3] is already declared: `\etc\codesys3.d\CmpWSServer.cfg`  
`\etc\codesys3.d\CODESYSControl.cfg`  
`\etc\codesys3.d\RtsCore.cfg`  
(If not available, use CODESYSControl.cfg as shown here: [Example: File Transfer](https://content.helpme-codesys.com/en/CODESYS%20Examples/_ex_visu_logging_of_variable_value_changes-1799730.html) )  
You need to add:

```auto
[CmpWebServerHandlerV3]
AllowFileTransferServices=1

```

Sorry I totally forgot about this one …

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [May 16, 2025, 8:39am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/18 "2025-05-16T08:39:52Z")

</div>

I added the line you advised me to all four files and it worked!  
Thank you!  
In the future I hope this will be taken into account in new PLC firmware so that this feature is immediately available.

---

<div class="post-metadata">

**Author:** ![WagoIcard](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagoicard/32/1508_2.png) [@WagoIcard](https://www.wago.community/u/WagoIcard)\
**Post date:** [May 19, 2025, 7:20am UTC](https://www.wago.community/t/saving-exporting-file-from-web-visualization-webvisu/1761/19 "2025-05-19T07:20:13Z")

</div>

I don’t think it should be enabled by default.  
But having an easier option to enable it would be a nice touch indeed.
