[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-15 Thread Anthony
Explicitly calling the .store() method should work in 2.4.6, but this method: db(db.mytable.id==24).update(file1=request.vars.file1) doesn't work in any stable version -- it only works in trunk (and therefore will work in the next stable release). Anthony On Thursday, August 15, 2013 2:39:13

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-14 Thread at
Thank you Anthony! That means it should be working in 2.4.6-stable? we've 2.4.6-stable on production server. Regards, AT On Thursday, 15 August 2013 10:55:50 UTC+5, Anthony wrote: > > Looks like there was a bug, which has now been fixed in trunk. So, the > second version will work in the next

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-14 Thread Anthony
Looks like there was a bug, which has now been fixed in trunk. So, the second version will work in the next stable release. Anthony On Thursday, August 15, 2013 1:26:18 AM UTC-4, at wrote: > > > 2.4.5 > > On Thursday, 15 August 2013 07:44:02 UTC+5, Anthony wrote: >> >> What version of web2py are

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-14 Thread at
2.4.5 On Thursday, 15 August 2013 07:44:02 UTC+5, Anthony wrote: > > What version of web2py are you using? > > On Wednesday, August 14, 2013 9:22:57 PM UTC-4, at wrote: >> >> Thanks a lot anthony, >> db(db.mytable.id==24).update(file1=db.mytable.file1.store(request.vars. >> file1)) >> works, >>

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-14 Thread Anthony
What version of web2py are you using? On Wednesday, August 14, 2013 9:22:57 PM UTC-4, at wrote: > > Thanks a lot anthony, > db(db.mytable.id==24).update(file1=db.mytable.file1.store(request.vars. > file1)) > works, > > whereas > db(db.mytable.id==24).update(file1=request.vars.file1) > gives error

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-14 Thread at
Thanks a lot anthony, db(db.mytable.id==24).update(file1=db.mytable.file1.store(request.vars.file1 )) works, whereas db(db.mytable.id==24).update(file1=request.vars.file1) gives error: ('ERROR', '22001', 'value too long for type character varying(512)') PS. I'd replied to your post yesterday,

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-13 Thread Anthony
On Tuesday, August 13, 2013 9:20:47 AM UTC-4, at wrote: > > Here is my controller code: > def test_upload: > if request.vars.file1 is not None: >result = db(db.mytable.id > ==24).update(file1=request.vars.file1.file) > request.vars.file1 is a cgi.FieldStorage object. The original file

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-13 Thread at
Here is my controller code: def test_upload: if request.vars.file1 is not None: result = db(db.mytable.id==24).update(file1=request.vars.file1.file) else: result = 0 return dict(result=result) status-5.png uploaded as applications/myapp/uploads/mytable.file1/85/mytable.

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-13 Thread Anthony
'txt' is the default extension given if the filename doesn't match the following regex: '\.(?P\w{1,5})$'. "picture.jpg" should match that regex, so something else is going on. Please show the full code used for the upload action as well as an actual filename that exhibits the problem. Anthony

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-13 Thread at
picture.jpg changes to picture.txt, infact to a long encoded name: mytable.file1.8cc66faf70ead672.746d70316a6c676677.txt Regards, Atif On Tuesday, 13 August 2013 17:25:28 UTC+5, LightDot wrote: > > Does .txt actually replace an existing extension, or does it show up > appended instead? What I

[web2py] Re: File extention automatically changes when a file is uploaded

2013-08-13 Thread LightDot
Does .txt actually replace an existing extension, or does it show up appended instead? What I mean is, does picture.jpg change into picture.txt or into picture.jpg.txt? Regards, Ales On Tuesday, August 13, 2013 12:10:40 PM UTC+2, at wrote: > > > > Hi, > > Please consider following model: > db.d