Hi
I am storing the attachment in the database. For some file the data
gets stored in the database but for other files it gives a MySql
error. For eg. when I am trying to attach the file say foo.txt it gets
stored in database correctly whereas the file bar.txt gives an error.
The error given is:
Traceback (most recent call last):
File "fakeloginserver.py", line 567, in _doRequest
_handleRequest(_wfile)
File "fakeloginserver.py", line 812, in _handleRequest
response.body=_theMethod(**(request.paramMap))
File "fakeloginserver.py", line 92, in invokeAddAttachment
add.addAttachment(v,filename,values)
File "C:\Python23\Lib\site-packages\cherrypy\code\Attachment_Model.py",
line 26, in addAttachment
n=cursor.execute("insert into attachments
values('%s','%s','%s','%s','%s','%s','%s','%s','%s ')"
%(Attachment_Model.projectid[0],values['issueid'],attachID,datetime,values['attachmentdescription'],contenttype,filename,values['attachmentpath'],submitterID))
File "C:\PYTHON23\Lib\site-packages\MySQLdb\cursors.py", line 95, in
execute
return self._execute(query, args)
File "C:\PYTHON23\Lib\site-packages\MySQLdb\cursors.py", line 114,
in _execute
self.errorhandler(self, exc, value)
File "C:\PYTHON23\Lib\site-packages\MySQLdb\connections.py", line
33, in defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1064, "You have an error in your SQL syntax. Check
the manual that corresponds to your MySQL server version for the right
syntax to use near 're just getting started with CherryPy, read the
tutorial (in do")
values['attachmentpath'] contains the file data.
The data type of the file data is LONGBLOB in MySql.
I am not getting why it works for some file but not for others.How can
I make it work for all files?? 1 2018 ke***********@yahoo.com,
Is it possible that the error is caused by a string
that has an ' in it? Thus yielding something like
'abc'xyz' - a string with an embedded '. The listed
're looks suspecious; like it was the end of you're
maybe.
wes ke***********@yahoo.com wrote: Hi I am storing the attachment in the database. For some file the data gets stored in the database but for other files it gives a MySql error. For eg. when I am trying to attach the file say foo.txt it gets stored in database correctly whereas the file bar.txt gives an error. The error given is:
Traceback (most recent call last): File "fakeloginserver.py", line 567, in _doRequest _handleRequest(_wfile) File "fakeloginserver.py", line 812, in _handleRequest response.body=_theMethod(**(request.paramMap)) File "fakeloginserver.py", line 92, in invokeAddAttachment add.addAttachment(v,filename,values) File "C:\Python23\Lib\site-packages\cherrypy\code\Attachment_Model.py", line 26, in addAttachment n=cursor.execute("insert into attachments values('%s','%s','%s','%s','%s','%s','%s','%s','%s ')" %(Attachment_Model.projectid[0],values['issueid'],attachID,datetime,values['attachmentdescription'],contenttype,filename,values['attachmentpath'],submitterID)) File "C:\PYTHON23\Lib\site-packages\MySQLdb\cursors.py", line 95, in execute return self._execute(query, args) File "C:\PYTHON23\Lib\site-packages\MySQLdb\cursors.py", line 114, in _execute self.errorhandler(self, exc, value) File "C:\PYTHON23\Lib\site-packages\MySQLdb\connections.py", line 33, in defaulterrorhandler raise errorclass, errorvalue ProgrammingError: (1064, "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 're just getting started with CherryPy, read the tutorial (in do")
values['attachmentpath'] contains the file data. The data type of the file data is LONGBLOB in MySql. I am not getting why it works for some file but not for others.How can I make it work for all files?? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Leon |
last post by:
I am trying to send an email with an attachment.
The problem is the attachment is stored in db where I have created a
longblob field that contains the file so I have no idea how to specify
the...
|
by: ketulp_baroda |
last post by:
Hi
I am storing the attachment in the database. For some file the data
gets stored in the database but for other files it gives a MySql
error. For eg. when I am trying to attach the file foo.txtit...
|
by: Bernhard Schmidt |
last post by:
------=_NextPart_000_0099_01C34B87.28543020
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
hi all
a question about checking the data of a longblob...
|
by: Davide |
last post by:
Perche' non riesco ad inserire immagini opiu' grandi di 1Mb in un campo
LONGBLOB? Ha forse il limite di 1Mb il campo LONGBLOB?
Se si, posso modificare tale limite?
Per le immagini inferiori a...
|
by: sudhakaranr |
last post by:
HI ALL,
I am new bie to mysql...I have 100 files as text files and each text file are having minimum 25 lines.I want to enter all the files in to Mysql DB.
My query is, In mysql...
|
by: phpfreak2007 |
last post by:
Hello,
whenever I am using above 2 datatypes(longblob / longtext) my PC is not responding. I want to get data from the database (MySQL) to dataset.
Thanks in advance.
|
by: mbenedict |
last post by:
I am rather new at this code and am attempting to modify existing code to use clob datatypes, which I have never used before. The database tables have been set up for clob data. When trying to use...
|
by: mirianCalin |
last post by:
the code saves the category, image title, image, and feature..
but the problem is that the "feature" is not saved, but the others were saved..
this is the data types of my table
category = text...
|
by: wizardry |
last post by:
hello -
ive inserted user names, etc. into the longblob but the path to the image is giving me a bit of a trouble.
do i need to change a mimi type or transformation of some sort?
i've...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |