[FileSystem] Uploaded files are getting deleted.

Forge Component
(33)
Published on 2019-02-21 by João Portela
33 votes
Published on 2019-02-21 by João Portela


I had a requirement that uploaded file (Image, Video, Doc) should save into folder instead of data base.

For this purpose, I have used file systems. I have created sub folder (directory) inside Application Directory C:\OutSystems\Sandboxes\YX96IJ002\Platform Server\running\ {Application Name}. and saving files there.

Please find below screen shot.

Now I have used uploaded file path inside CK Editor to fetch the files. e.g

<img src="\IPCity\DevSecOps\dso_newintro_thumbnail.png" />

I have notice couple scenario, where sub directory and files are getting deleted

1. When the environment gets upgraded.

2. When a developer republishes the previous version at the service center.

3. After Production deployment, files are getting deleted from the production environment.

Once the files get deleted, we are uploading all files again.

I would like to know, why this happen and Can you please tell me, what should I do so files won’t be getting deleted and I can refer that uploaded fie path in ck editor.

It would be great if team can give me solution.

Note : I have checked with demo application as well and it is happening same when you re-publish previous version from service center, uploaded files are getting deleted. 

steps to reproduce this scenario.

just do some valid change and publish. so that we will have few version in service center.

1) check file count and file list of directory

2) Upload few files using file menu. and check directory menu . you will see count has been increased and uploaded file is getting listed as well.

3) Go to service center and publish previous version.

4) now you can notice that uploaded file got deleted. check directory menu and list directory.


Can anyone have solution for this

Thanks in Advance

Hello Mithun.

When you publish a module, a new folder is created and IIS starts pointing to it, leaving the old one behind.

If you place the files in the application folder, it will change

You need to find a specific folder on the server (outside IIS) to be sure it won't be deleted.

Nuno Reis wrote:

Hello Mithun.

When you publish a module, a new folder is created and IIS starts pointing to it, leaving the old one behind.

If you place the files in the application folder, it will change

You need to find a specific folder on the server (outside IIS) to be sure it won't be deleted.

Hi Nuno.

Thanks for your inputs. I am agree on IIS server part and I have figured out the same.

Do you suggest any specific folder on the server (outside IIS) so that I can save my files there and refer file path in application.



I wouldn't place it in C:\OutSystems. Leave that one to the app.


Maybe create a C:\OutSystemsApplications\UploadedContent\[AppName]\CKEditor

This gives you flexibility to upload files in different ways from that app and from other apps. Each getting their own location.


Nuno Reis wrote:

I wouldn't place it in C:\OutSystems. Leave that one to the app.


Maybe create a C:\OutSystemsApplications\UploadedContent\[AppName]\CKEditor

This gives you flexibility to upload files in different ways from that app and from other apps. Each getting their own location.



Let me give try for this way. but I doubt that uploaded file path will work in CK Editor or throughout the application.