Anvil Creating a directory

What I’m trying to do:
I’m trying to create a directory/folder within data files.
How do I do this?

The correct way is to take a folder and add it to the data files service.

You can do it from code, but its not supported and unadvised.

1 Like

Try it. Dropping the folder dosent work, I tried many times. I dragged and dropped a folder and it did absolutely nothing.

Okay, I tried just now and the only thing I can think of is it seems to not allow an “empty” folder to be put there. This makes sense, since the data files are just an abstraction of storing the files in a data table, and the actual file entry (a row) in the data table is what holds the path information attached to it. This abstraction also supports cashing and creates file handler objects for you which is its main feature.

Also just to be sure, as of now data files are only available with one of the the full python environments, since they use sqlite3 for cashing the files and that is not available in the free plan version of the server modules.

data_files_folder

Oh, also I forgot to say last time, welcome to Anvil :wave:

I already tried dragging a folder with files in it. It seems to have no interaction to the dropbox.
I did it like you did in the photo attached.

If you are looking at a bug, lets get some info the staff will ask anyway, like what browser you are running , what OS etc, or any other details.

I am using Chrome 111.0.5563.65 and Windows 10, I will try dragging a file in firefox as well to see if I can replicate the problem.

If we think its a bug I can change the thread title to include something like [Possible Bug] to attract more attention.

1 Like

Right here is something interesting that I found out:

  • Adding a folder within a folder, that contains a .txt file, I was unable to upload this however;
  • Adding a folder within a folder, with an image or a different file format allowed me to upload it.
    As a result, I had to upload the ^ the step 2 and then delete the png, and replace with a .txt file which is neccessary for my project
2 Likes