Uploading images into database using webforms...
Hi,
I'm trying to upload images in to the database. This is possible on a normal form running the forms runtime, but how do i do it when is comes to webforms?
Thanx in advance!
hai roshapt
what is the fine extension u r using.to get the images to disply in web also place the image file in the same path where u place the
.fmx forms or create a virtual directory for images and configure that virtual directory also.
regards
ramesh.
Similar Messages
-
How to upload images into database.
I have a employee table. I want to upload the image of the corresponding employee. How can we achieve this ??
Edited by: Manjunath CN on Oct 14, 2008 2:15 PMHi Manjunath,
Please check Sikindar post in this link
Photo Upload
Tcode OAAD.
Click on the Create button. Business object PREL and Docyment type HRICOLFOTO. Click on create (fill in the right personnel number in the pop up and click Continue).
Choose the photo (as a JPG file) from the place where it is saved (e.g. hard disk). SAP will notify that the Stored Document was created succesfully.
Photo is visible via PA10, PA20, PA30, PA40. Double-click to magnify photo.
Best regards,
raam -
How to insert files or images into database using mysql
i need one example how to store files and retrive from database
give me examples on storing and retriving foles or imageshttp://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/htdocs/templates.htm#LOBS
-
FileNotFoundException Uploading image to database
Hello
I'm trying to upload image to databases, in my server it works perfectly but when i run the application in the hosting appear FileNotFoundException.
This is the part of html file than call to servlet.
<FORM ACTION="http://hosting/servlet/lordcyb3r.Connect">
<center><h4><b>Insert image</b></h4></center><BR><BR>
Name:
<input type="text" class="bginput" name="nombre" value="" size="40"/><BR>
<input type="hidden" name="c" value=""/>
<input type="file" class="bginput" name="image" size="40"/><BR>
Comment:
<input type="text" class="bginput" name="comentario" value="" size="60"/><BR>
<INPUT TYPE="SUBMIT" VALUE="Insert">
</FORM>
This is the get method of Connect servlet
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String nombre = request.getParameter("nombre");
String ruta = request.getParameter("image");
String comentario = request.getParameter("comentario");
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection connection = DriverManager
.getConnection("jdbc:mysql://host/db?user=userid&password=psw");
PreparedStatement ps = connection
.prepareStatement("insert into imagedata values ( ?, ?, ?, ? )");
ps.setString(1, nombre);
ps.setString(2, ruta.substring(ruta.lastIndexOf("/") + 1));
ps.setString(3, ruta.substring(ruta.lastIndexOf(".") + 1));
ps.setString(4, comentario);
ps.execute();
ps = connection
.prepareStatement("insert into image values ( ?, ? )");
File file = new File(request.getParameter("image"));
InputStream is = new FileInputStream(file); // LINE 86 <--- HERE IS THE EXCEPTION
ps.setString(1, nombre);
ps.setBinaryStream(2, is, (int) file.length());
ps.execute();
is.close();
connection.close();
out.println("<br><br>Imagen insertada con �xito");
} catch (InstantiationException e) {
out.println("<br><br>InstantiationException");
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
out.println("<br><br>IllegalAccessException");
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
out.println("<br><br>ClassNotFoundException");
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e1) {
out.println("<br><br>SQLException");
// TODO Auto-generated catch block
e1.printStackTrace();
This is the StackTrace.
java.io.FileNotFoundException: G-Natalia Duque.jpg (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at lordcyb3r.Connect.doGet(Connect.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:95)
at com.caucho.server.http.Invocation.service(Invocation.java:291)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:339)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:268)
at com.caucho.server.TcpConnection.run(TcpConnection.java:136)
at java.lang.Thread.run(Thread.java:602)
Can you help me?
I think so the method is searching the image in the server and no in the client.
If is this, How can i do it works?
Thanks for your help.to upload the file basic thump rule is the form type is multipart form data and method should be post.
u have to use any upload component to upload the file from the client machine to the server and then u have to upload it to the database
baiju -
Error in importing image into SAP using SE78
Hi to all,
I was trying to upload a '.bmp" image into SAP using SE78 but I failed.
Se78 -> BMAP Bitmap Image -> Graphic -> Import -> Specified the complete path ->given name desc and type .
Ended up with the following message.
Graphic TRF_LOGO_REV could not be saved
(2TRF_LOGO_REV)
Pls. help as I am not sure whether I missed any step.
Thankx in advance.Hi,
Go to SE78 Transaction ie Aministration of form graphics,
there select GRAPHICS General Graphics,under this BMAP Bitmap Images will come.
select that,then a sub window will appear.
There give the name of your logo and select the import button which is at the extreme left.
Then again a sub window appears,there give the path name and name of the logo,and some description then press enter.
Now the logo is uploaded,for preview you can select last button which is print preview.
Now goto the form,select the window where you want to print the logo.
Then in that window place the cursor at tag coloumn and select command line.
Now go to INSERT and select GRAPHICS.A subwindow appers click on 'stored on Document Server',
give the name of the logo and press enter.
Then the image information will be displayed on the form.Save the form and activate it.
Go to se38 transaction write the print program and execute.
Regards,
jaya -
hello, i have been fighting with this for some days, i have a picture that i load with de filerence.load method. and then,
i use the filereference.data to show the picture into the image control.
i need to save the image into database, but i can't. i don't know how i can convert the bytearray into hexa string or binary!!!Hi Sai,
I am getting the error ArgumentError: Error #2015: Invalid
BitmapData. When I am trying to change the image into byteArray using
BitMapData.
Below is the code i am using for this scenario. I am trying to get
byteArray of the image after the image is completely loaded in the
onComplete().
private function initFunction(event:Event):void{
uploadFile =new FileReference();
imgTypes=new FileFilter("images(.JPG,.JPEG,.PNG,.GIF)",*
".JPG;.JPEG,.PNG;.GIF;"*);
private function browseFile():*void
uploadFile.addEventListener(Event.SELECT, onFileSelected);
*try
uploadFile.browse();
catch(err:Error)
logData(err.message);
private function onFileSelected(event:Event):*void
uploadFile.addEventListener(ProgressEvent.PROGRESS, onProgress);
uploadFile.addEventListener(Event.COMPLETE, onComplete);
uploadFile.load();
private function onProgress(event:ProgressEvent):*void
logData("Loaded " + event.bytesLoaded + " of " + event.bytesTotal + *"
bytes."*);
private function onComplete(evt:Event):*void
logData("File was successfully loaded.");
*//image.source = uploadFile.data;
image.source=uploadFile.name;
Alert.show("image source:"+image.source);
var bitmapData:BitmapData = new BitmapData(image.width,image.height);
var ba:ByteArray = png.encode(bitmapData);
Alert.show("bytes loaded"+ba);
Thanks,
Ravi.
On Sat, Nov 20, 2010 at 9:19 PM, ravindharreddy Baddam < -
How to store an image into database table
Hi
Can anyone tell me the way, how to store an image into database table.Hello,
May be this thread will help you in your requirement.
[FM for uploading Image to SAP;
Thanks,
Jayant -
How to upload data into IT0000 using ABAP-HR program
Hello,
I'm required to upload data into multiple infotypes [IT000, 0001, 0002, etc] using single input text file. Can anyone able to guide me, how to upload data into IT0000 using ABAP program ?
Thanks in advance.
Regards
Prabhakar.
Message was edited by:
Prabhakara MuthyalExample code for HR_MAINTAIN_MASTERDATA to COPY IT0002
DATA: INT_0002_FINAL TYPE STANDARD TABLE OF PA0002 WITH HEADER LINE.
DATA: VALUES LIKE PPROP OCCURS 10 WITH HEADER LINE,
RETURN LIKE BAPIRETURN1,.
LOOP AT INT_0002_FINAL.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-PERNR'.
VALUES-FVAL = INT_0002_FINAL-PERNR.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-BEGDA'.
VALUES-FVAL = INT_0002_FINAL-BEGDA.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-ENDDA'.
VALUES-FVAL = INT_0002_FINAL-ENDDA.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-nachn'.
VALUES-FVAL = INT_0002_FINAL-NACHN.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-gblnd'.
VALUES-FVAL = INT_0002_FINAL-GBLND.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-vorna'.
VALUES-FVAL = INT_0002_FINAL-VORNA.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-rufnm'.
VALUES-FVAL = INT_0002_FINAL-RUFNM.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-name2'.
VALUES-FVAL = INT_0002_FINAL-NAME2.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-inits'.
VALUES-FVAL = INT_0002_FINAL-INITS.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-famst'.
VALUES-FVAL = INT_0002_FINAL-FAMST.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-gbdat'.
VALUES-FVAL = INT_0002_FINAL-GBDAT.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-sprsl'.
VALUES-FVAL = INT_0002_FINAL-SPRSL.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-anzkd'.
VALUES-FVAL = INT_0002_FINAL-ANZKD.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-natio'.
VALUES-FVAL = INT_0002_FINAL-NATIO.
APPEND VALUES.
* maintain master data
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = INT_0002_FINAL-PERNR
ACTIO = 'COP'
BEGDA = INT_0002_FINAL-BEGDA
* ENDDA = INT_0002_FINAL-ENDDA
SUBTY = SPACE
NO_ENQUEUE = SPACE
DIALOG_MODE = '0'
TCLAS = 'A'
IMPORTING
RETURN1 = RETURN
TABLES
PROPOSED_VALUES = VALUES
* MODIFIED_KEYS =
EXCEPTIONS
OTHERS = 1.
IF RETURN IS INITIAL.
WRITE:/' Done....'.
ELSE.
WRITE:/ RETURN-ID, RETURN-TYPE, RETURN-NUMBER, RETURN-MESSAGE_V1, RETURN-MESSAGE_V2, RETURN-MESSAGE_V3, RETURN-MESSAGE_V4.
ENDIF.
CLEAR VALUES.
REFRESH VALUES.
ENDLOOP. -
How to store images in database using java
hii
how to store images in database using java..........
Message was edited by:
naveennagaI asked a similar question once and the answer I got was - Don't.
Instead, store the images on a drive somewhere and store the path in the database.
But I'm no expert - that's just what I was told by someone who does this kind of stuff a lot.
Hope that helps. -
How to eliminate inserting Duplicate rows into database using JDBC Adapter
File->Xi->JDBC
In above Scenario if the file has two rows their values are identical, then how can we eliminated inserting Duplicate rows into database using JDBC AdapterDatabase is a consumer of a SERVICE (SOA!!!!!!).
Database plays a business system role here!!!!
Mapping is part of an ESB service
Adaptor is a technology adapted to ESB framework to support specific protocol.
ESB accomplish ESB duties such as transformation, translation, routing. Routing use a protocol accepted by the consumer. In a JDBC consumer it is JDBC protocol and hence it a JDBC adaptor.
There is clear separation on responsibilities among business system and ESB. ESB do not participate in business decision or try to get into business system data layer.
So who ever are asking people to check duplicate check as part of mapping (an ESB service) may not understand integration practice.
Please use an adaptor module which will execute the duplicate check with business system in a plug and play approach and separate that from ESB service so that people can build integration using AGILE approach.
Thanks -
Upload Image into Answer?
Hi all, is possible upload images into Oracle Interactive Dashboard?
And...if it is possible, where is the option for upload?
Thanks
byeyes its possible. you will find lots of threads in OBIEE forum.
-
Upload image into mysql database residing on remote server is not working?
hello to all,
i need ur help,we hav online site .
i have to upload image(which can b from any pc) into mysql database residing on remote server of which we (don't hav actual path of that server).
the solution i'm using is working correctly on local bt when transfer it to server it shows
java.io.FileNotFoundException: (No such file or directory)
i have used multipartRequest to access parameter of file type input.
all variables and related packages r imported properly.no prblm in that.
code is here....................................
try {
MultipartRequest multi = new MultipartRequest(request, ".", 500000 * 1024);
File f = multi.getFile("uploadfile");
out.println(f.getName());
filename = f.getName();
String type = multi.getContentType(f.getName());
fis=new FileInputStream(filename);
byte b[]=new byte[fis.available()];
fis.read(b);
fis.close();
Blob blob=new SerialBlob(b);
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://10.1.52.206:3306/test?user=root&password=delhi");
String query="insert into uploads (FILENAME,BINARYFILE,) values (?,?)";
pstmt=con.prepareStatement(query);
pstmt.setString(1,filename);
pstmt.setBlob(2,blob);
int i=pstmt.executeUpdate();
if(i>0)
out.println("Image Stored in the Database");
else
out.println("Failed");
} catch (Exception ex) {
out.print("*******************"+ex);
ex.printStackTrace();
please suggest me the way to upload image to remote server** not on local server.
its urgent.
Edited by: JavaDevS on Jul 28, 2008 11:41 AMi need ur help,we hav online site .Please don't use these juvenile abbreviations. It's impolite when you're asking for assistance not to make the effort to spell out all of the words. Moreover in a forum with an international readership the use of standard English will reduce the possibility of confusion.
I presume that your file upload is being placed in a different directory from that which you were expecting. I would suggest logging all paths (specifically filename) to see if this is an unexpected value.
Please explain further what you mean by "local" - is this a stand-alone application, or merely running a copy of the server on your local machine and doing the transfer (via the browser) to that? Are there any other differences such as the browser used? -
How to read and upload microsoft word file into database using forms9i
Hi,
How to read and upload microsoft word file into oracle database using forms9i. I appretiate if anyone can send me example or atleast a sujjetion.
Thanks in advance
Mahesh RagineniThe webutil package includes the ability up upload from the client to the database. See otn.oracle.com/products/forms and click on webutil for more details.
Regards
Grant Ronald
Forms Product Management -
Problem while uploading Image to DataBase
Hi ,
i m getting exception while executing code below,
is there anything to configure the data base before uploading images onto the database....
Connection con=null;
try{
Class.forName("youroracledriver").newInstance();
con = DriverManager.getConnection("url");
PreparedStatement ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
File file=new File("F:/servletworkspace/insertingimage/bb.jpg");
FileInputStream fs = new FileInputStream(file);
ps.setInt(1,15);
ps.setBinaryStream(2,fs,(int)file.length());
int i = ps.executeUpdate();
if(i!=0){
out.println("image inserted successfully");
else{
out.println("problem in image insertion");
catch (Exception e){
System.out.println(e);
}To connect to database if your need to register driver and then make connection. So instead of:
user8689318 wrote:
Class.forName("youroracledriver").newInstance();
con = DriverManager.getConnection("url");you should have (if you are connecting to oracle using oracle jdbc driver):
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
con = DriverManager.getConnection("jdbc:oracle:thin:@<your db listener ip>:<your db listener port>:<your db sid>", "<db user>", "<db user password");
plus in future if you getting exception, then you should post it as well -
How to upload images to server using flex and blazeDS
Hi All,
Could you some help me, regarding uploading two images while click on the upload button. i am have two browse buttons and two upload buttons. i am able to select the image, while click on the browse button. but i am unable to upload the image, while click on the upload button. like this, i have to do in my application.
if some help me i will appreciate , its very urgent.
Thanks
venkatWhen uploading a file, I use a byte array as a temporary buffer..
So, you should then be able to store the byte array in the
database as binary data.
example>
//Temporary Buffer To Store File
byte[] tmpbuffer = new byte[860];
//Some Code To Upload File...
//File Should Now Be In Byte Array
//Get DB Connection and execute Prepared Statement
Connection con=//GET DB CONNECTION;
String sql=insert into TABLE(page) values(?);
PreparedStatement ps=con.prepareStatement(sql);
ps.setBytes(1,tempbuffer);
ps.executeUpdate();
//Close PS and Free DB Connection
..... and this method looks like you dont even have
to store the file in a byte array, you can just give
it the input stream.
ps.setBinaryStream(int, inputStream, int);
You may have to make several attempts at this. I have
uploaded a file and temporarily stored it in a byte array,
but have never from there stored it in the DB as binary
data.. but this looks like it'll work.
Good Luck!
Maybe you are looking for
-
Using field highlighter to highlight records with a certain date range
I've been asked to highlight a field based on the fact that the "Submit" date is greater than a certain value. The problem is that there's no way to pre-determine what that value is. It changes. The user wants to be prompted for the value when he run
-
How do I edit and sign documents using adobe?
How do I edit and sign documents using adobe?
-
Possible to save files in My Documents using JavaScript?
I have a customer who wants his users (service technicians) to be prompted to save a PDF form they fill out, print, and sign for their customers. It's easy to set the File>Save As action for the form button, but my customer wants to know if it's poss
-
Valuation area HDQF not yet productive with material ledger
Dear all, When i PGI, there is an error: Valuation area HDQF not yet productive with material ledger. Pls help me to resolved. Thanks & Regards,
-
Uninstall CS5 after upgrade to CS5.5 Production
I have recently upgraded to CS5.5 production and would like to know if I should remove CS5 now that I am running 5.5? Or is there any reason to keep both on my computer? Is there any special method of uninstalling the old suite.