Hi Anthony,
I was using 2.9.5 before the upgrade.
In the end, I found that it may be that the part of the code than handles uploads through a filesystem never did work with the « uploadfolder » attribute (i.e. it might have been a patch I made a few months ago and lost in the process of the upgrade).
In any case, here is the solution to my issue if anyone ever meets it :
In dal.py, line 10211:
os.makedirs(path)
pathfilename = pjoin(path, newfilename)
if self.uploadfs:
- dest_file = self.uploadfs.open(newfilename, 'wb')
+ dest_file = self.uploadfs.open(pathfilename, 'wb')
else:
dest_file = open(pathfilename, 'wb')
try:
In dal.py, line 10249:
stream = StringIO.StringIO(data)
elif self.uploadfs:
# ## if file is on pyfilesystem
- stream = self.uploadfs.open(name, 'rb')
+ fullname = pjoin(file_properties['path'], name)
+ stream = self.uploadfs.open(fullname, 'rb')
else:
# ## if file is on regular filesystem
# this is intentially a sting with filename and not a stream
With this, the DAL should be able to both write and retrieve files through a filesystem whilst still taking in consideration the prefixed folder (i.e. the « uploadfolder » attribute).
That’s very handy if you need to specify multiple upload locations in your bucket.