I have 2 similar controller functions using SQLFORM() with an upload field.
One works and one is giving an error online (not when testing locally). I
suspect a file system permission problem but I am not sure.
The error only occurs if an image is uploaded.
The extra processing after the form is
Hello.
I have in model:
Field('avatar', 'upload', required=False, autodelete=True, label=T('Avatar'),
uploadfolder=os.path.join(request.folder, 'static/images/avatars'),
requires=[IS_LENGTH(16384), IS_IMAGE()])
Well, the logic is simple: "avatar is not necessary, but when it
hi,
i have upload field type doesn't show in grid or smartgrid, in the older
version i believe it shown by default. is it normal in the recent version
(2.12.3) not shown the upload field type by default?
ref:
http://web2py.com/books/default/chapter/29/03/overview#Adding-grids
p.s.
in the book
Hi!
I want to upload a file type .PDF in upload field but I only aceept this
type of file.
What can I do?
I hope you can help me.
Best regards.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Hello i have an app that was designed with some required upload fields.
Now after 1 year and around 5gb in my download folder, someone tells me
that the upload fields are not required anymore under some scenarios.
I cannot delete the required value from my dal because the sqlite does not
let it.
I have three tables:
- invoices
- invoice summaries
- invoice bundles
The website I am working on provides such a functionality, that user
uploads a file, from which invoices and invoice summaries are generated and
after being generated they are zipped and put into a bundle.
For each upload I
I have a table with upload field defined as follows: Field('file',
'upload', uploadseparate=True) . When I create some items using database
administration, the image is displayed correctly. When I involve
SQLFORM.grid in my controller, the link to file is not correct. See two
links below:
OK
I'm not sure why this is difficult, but I see many posts about this when I
search, yet none exactly work for me. This seems like it should be easy
but is surprisingly difficult in web2py.
I want to keep a table of uploaded files with the uploads in a blob field
and the names in clear text in
hello one and all,
i am doing en masse data table using xml data to a table that has an upload
field. the files are already present in the upload subdirectory but i need
to populate the table with the data, including the file name that is the
upload field. i hope that made sense.
how do i
AFAIK upload fields are just string fields, so you can insert any string there!
db.table.insert(filefield=blah)
should work!
You just have to use Python glob, os, sh or shutil to take a list of files and
then populate the database.
On Tue, Dec 25, 2012 at 03:40:51PM -0800, lucas wrote:
You can do it and it will work. But you will not be able to download it
using the download action. That is because it expects a certain format
for filenames. You will need a custom download action that would know how
to located the file from its name.
Massimo
On Tuesday, 25 December 2012
well, i get this error
Traceback (most recent call last):
File /opt/web-apps/web2py/gluon/restricted.py, line 212, in restricted
exec ccode in environment
File /opt/web-apps/web2py/applications/iquanta/controllers/site.py
ok, what if i just upload the file? how do i do that programmically? lucas
--
https://groups.google.com/forum/?fromgroups=#!searchin/web2py/upload/web2py/CWNwcgo3wIU/1K_7wJBPh-0J
On Tuesday, 25 December 2012 20:51:21 UTC-6, lucas wrote:
ok, what if i just upload the file? how do i do that programmically?
lucas
--
Is there any way to keep the value that was inserted on an upload
field after failing to validate the form due to another field, so that
the user doesn't have to search for the file again?
Have to go to the experts for this. I have a table for storing
arbitrary user data:
db.define_table('extra_attributes',
Field('user', db.auth_user),
Field('name'),
Field('type', requires = IS_IN_SET(('text','file'))),
Hi *,
is there a way to modify the file name with whom a file is stored in the
filesystem using an upload field?
I tryied in this way but without success:
def upload_static_overlay_form_processing(form):
# here form.vars.shp contains the file object and
## form.vars.shp.filename is the
No, blob is optional, and it'll work well without specifying a blob field.
(I use only upload and it works on GAE too)
I´m trying to find out how form.accepts handles the uploading of files
(for my mail gateway) and made a form
form=SQLFORM.factory(Field('text','string'),
Field('upload','upload'))
When I submit a form I get a ticket stating
you must specify a
You need a upload field to store the path and a field to store the name of
the file... The book is not clear I think about upload particularly about
blob storage...
My model :
Field('chroma','upload',uploadfield='chroma_blob'),
Field('chroma_blob','blob'),
You need both doen't matter if you use
Hello,
i work with Web2Py on GAE. I try to make a db.insert with
SQLFORM.factory method.
def test():
form = SQLFORM.factory( Field('logo','upload'))
if form.accepts(request.vars, session):
new_domain = db.domain.insert(logo = request.vars.logo)
response.flash='cool'
Hopefully this is a quick one...
I want to use SQLFORM to allow a user to save information about a file
including the *local path*. However I don't want to actually save the
file in the database. The idea is to parse the local path and save a
portion of it to the db that will match a file
22 matches
Mail list logo