Jump to content

Improvements to file uploading when file with same name is uploaded


apeisa
 Share

Recommended Posts

Currently fieldtype creates a new file with suffix like filename_1, filename_2 when files with same filename is uploaded. Most of the time this is good, but sometime it would be good to allow overriding the file. Would it be difficult to check if similar file exists and offer a js confirm wheter to override or create a new file?

This is of course for multifile fields, since single file fields override always (not sure if that is every time preferred without confirmation?).

I will take a look at this myself at some point, but interested to hear what others think about this? Which would be best UI here?

  • Like 2
Link to comment
Share on other sites

This sounds good to me. I'm guessing we could do the JS confirm pretty easily from the ajax upload, though probably not from the oldschool one. So might be good to have a setting that goes with the file field as to whether the default behavior is to overwrite or rename. It'll also require some changes in the WireUpload class, but I don't think anything too major.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
About files, is there any good solution found to the max amount of files that can be stored in a folder ? For example if you have a site with user generated content, page folders can quickly out grow the maximum amount of stored files in a folder.

It depends on the file system. In a common ext3 with dir_index file system there is apparently a limit of 32k subdirectories per directory, and no practical limit on quantity of files in a directory. In a common ext4 file system there apparently is no limit on subdirectories or files, but a maximum individual file size of 16 TB, so be careful. :biggrin:

Link to comment
Share on other sites

  • 2 weeks later...
Sorry ryan, saw this message today... So you say when hosting a site on server with ext4 file system, there's no real file issue for PW.

That's my understanding after doing some research online. Though I've not ever pushed those upper limits so just repeating what I've read rather than speaking from personal experience.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...