Re: [web2py] Re: uploadfolder outside web2py

2018-01-17 Thread Richard Vézina
Symlink is another option... I had use symlink for a while for uploads files as I was storing them on another system, so they were backuped and reduced the size of my linux box... I stop doing it because there network latency and the mount point was often down. But it works very well... Richard

[web2py] Re: uploadfolder outside web2py

2018-01-17 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for helping me solve the issue, I very much appreciate your help. @richard. Thanks for your reply, I had a look at bindfs, I work with Linux and had a symbolic link on myapp/static/uploads I am not sure bindfs let me upload files to myapp/static/uploads and store them in a

Re: [web2py] Re: uploadfolder outside web2py

2018-01-16 Thread Richard Vézina
You can also mount the directory you want you file in into web2py folder with bindfs... Or saying it differently mount a directory to another location... https://bindfs.org/ But I think it would be only working with linux. Good luck Richard On Mon, Jan 15, 2018 at 11:22 AM, Anthony

[web2py] Re: uploadfolder outside web2py

2018-01-15 Thread Anthony
First, consider whether you really need a separate upload folder for each vertexID. The DAL already generates a unique filename for each upload, and the filename is stored in the database record, so you can always find the file by looking up the record. If you need the separate folders,

[web2py] Re: uploadfolder outside web2py

2018-01-15 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. After reading the parts on download() in chapter 7 and 9 I wrote the following functions: def logo(): vertexID = session.vertexID table.vertexID.default = vertexID folder = 'vertexID' + str(vertexID) table.image.uploadfolder =

[web2py] Re: uploadfolder outside web2py

2018-01-14 Thread Anthony
On Sunday, January 14, 2018 at 4:30:57 AM UTC-5, Annet wrote: > > Thank you all for your replies, > > This works : > > table.image.uploadfolder = '/home/webapps/uploads' > > to upload the images into separate folders I made the following adjustment: > > folder = 'vertexID' + str(vertexID) >

[web2py] Re: uploadfolder outside web2py

2018-01-14 Thread 'Annet' via web2py-users
Thank you all for your replies, This works : table.image.uploadfolder = '/home/webapps/uploads' to upload the images into separate folders I made the following adjustment: folder = 'vertexID' + str(vertexID) table.image.uploadfolder = os.path.join('/home/webapps/uploads/' + folder) The

[web2py] Re: uploadfolder outside web2py

2018-01-12 Thread Anthony
On Friday, January 12, 2018 at 5:18:30 AM UTC-5, 黄祥 wrote: > > pls try: > table.image.uploadfolder = os.path.join(request.folder, '..', '..', '..', > 'webapps', 'uploads') > Also, unless it needs to be portable to other filesystems where the path does not start with "/home", you can simplify

[web2py] Re: uploadfolder outside web2py

2018-01-12 Thread Dave S
On Friday, January 12, 2018 at 12:07:22 AM UTC-8, Annet wrote: > > In web2py I have an init application and an adminmod application > containing the model, module and static files. > > To manage images I have the following code in a function: > > > table.image.uploadfolder =

[web2py] Re: uploadfolder outside web2py

2018-01-12 Thread 黄祥
pls try: table.image.uploadfolder = os.path.join(request.folder, '..', '..', '..', 'webapps', 'uploads') assuming there are folders: /home/web2py/applications/adminmod /home/webapps/uploads according to your path, i think it just a little adjustment of parent folder ,'..', '..' best regards,