Upload image in executable program
hi,
upload a image into executable program, with out using se78.
thank you,
dinesh.
Hi Dinesh
use the transaction OAER.
Pushpraj
Similar Messages
-
Error message "This program cannot display the webpage when uploading images to Cafe Press
I have had a Café Press shop for five years and except for sometimes being slow, no problems uploading images. Now, suddenly for 3 days I get the message "This program cannot display the webpage
Most likely causes:
• You are not connected to the Internet.
• The website is encountering problems.
• There might be a typing error in the address.
What you can try:
Check your Internet connection. Try visiting another website to make sure you are connected.
Retype the address."
I got the messsage about half way through the uploading of an image. People suggested using "firefox" instead of IE so I now get a similar error message from Firefox. I signed in, clicked on the image I wanted to upload and hit "upload" and get message as follows:
Server not found
Firefox can't find the server at members.cafepress.com.
* Check the address for typing errors such as
ww.example.com instead of
[url=http://www.example.com]www.example.com[/url]
* If you are unable to load any pages, check your computer's network connection.
* If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
None of this makes sense because I WAS connected to the internet (obviously) or I wouldn't have been able to sign in, go to my media basket, browse for the image and click "upload" and watch as the progress bar showed percentage of upload such as 20%, etc. and even went to 100% at times before giving me the error message. Plus I couldn't make a typing error since I wasn't typing anything but uploading an image. Any suggestions?
Whatever your suggestion, I need step by step instructions as I am totally computer illiterate. I don't even know what a "proxy" is and don't know if I have a "firewall" as the message suggests. I have "Comodo" security and am using Windows XP.
I contacted CP which was no help at all. All they did was tell me to clear my cache which I do after every session. Thanks
Nancy
http://www.cafepress.com/calendarflrSounds like your desktop application is in fact running from
a server. CHMs were identified as a security risk by Microsoft and
are best suited to the user's PC.
Click
here for more information. -
How to upload images on WebDynpro(ABAP) screens
Hello All,
Could any one please help on how to create/change the image (jpeg/any file) dynamically on WebDynpro screen. I have seen couple of examples for uploading the text files in WDR_TEST_EVENTS, WDR_TEST_WEB_ICONS, but not found any standard program that explains about uploading images.
Requirement: User has to select any image/thumbnail from local PC and it should be displayed on main screen, it's not only from MIME directory.
We have the same logic in BSP Application (CFX_RFC_UI) to upload the thumbnail but am not sure whether we can use the same logic in WDC or not?
I have seen the same logic for WebDynpro (JAVA) here:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71
I would really appreciate if you could provide me the code/process ASAP.
Thanks & Regards,
Hari.Hi,
I have written the code as per given logic with no errors, after selecting jpeg file from local PC when I click on 'upload' button it is giving a following short dump.
Could you please let me know how to rectify it.
Error when processing your request
What has happened?
The URL http://rocpld02.wwwint.corp:8000/sap/bc/webdynpro/sap/zms_image_01/ was not called due to an error.
Note
The following error text was processed in the system PLD : Exception condition "CNTL_ERROR" raised.
The error occurred on the application server rocpld02_PLD_00 and in the work process 1 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: CONSTRUCTOR of program CL_GUI_CUSTOM_CONTAINER=======CP
Method: ONACTIONONBUTTONCLICK of program /1BCWDY/1I6RRYQYFWRI2HBZ5MAK==CP
Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/1I6RRYQYFWRI2HBZ5MAK==CP
Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP
Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
Regards,
Hari. -
Can not upload image of larger size in jsf
i had some issues in file uploading. File uploading is working fine in my local machine and when i am using the www.mywebsite.com:8080/fileUpload.jsf
but i can not upload images by using the following www.mywebsite.com/fileUpload.jsf
Ie: without the port. I am using windows server and tomcat 5.5.27
When i am trying to upload a bigger size image i am getting the following error
I am using jsf(tomahawk)
09:10:47,315 ERROR MultipartRequestWrapper:? - Exception while uploading file.
org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Socket read failed
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
at org.apache.myfaces.webapp.filter.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:85)
at org.apache.myfaces.webapp.filter.MultipartRequestWrapper.getParameter(MultipartRequestWrapper.java:181)
at org.apache.myfaces.context.servlet.RequestParameterMap.getAttribute(RequestParameterMap.java:42)
at org.apache.myfaces.context.servlet.AbstractAttributeMap.get(AbstractAttributeMap.java:91)
at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getTreeStructureToRestore(HtmlResponseStateManager.java:159)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.getSequenceString(JspStateManagerImpl.java:260)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreTreeStructure(JspStateManagerImpl.java:230)
at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:267)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:231)
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:81)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.zerone.rrs.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:444)
at org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:472)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
at java.lang.Thread.run(Unknown Source)Never mind . problem solved after i restarted
-
How do i create a website that allows customer to upload images and text?
I need some help i have a friend who has asked me if i can create a website that allows them to upload their own images and text at their leisure.
His company is in the car sales trade so they need to regularly be updating their stock, and this needs to be done by somebody with limited computer knowledge so ease of use is fairly important.
I am using dreamweaver cs4 on a G5 Imac running Snow leopard 10.6.8, my skills are limited to creating uncomplicated websites but i am very keen to learn, i am aware of content management systems such as Druplal but have zero knowledge on how to use these.
Any assistance would be greatly appreciated
Andy Barrington
www.andybarrington.comYou can take a read here
http://www.hotscripts.com/category/php/scripts-programs/classified-ads/autos/
http://icloudcenter.com/auto-dealer-car-sales-script.htm
Although putting together a form that would upload images and all the descriptions required seems like a fairly straghtforward project, depending on your current skill set.
Gary -
Upload image with Zprogram instead se78
Dear Gurus ,
I founf in sdn a useful program that upload images instead se78.
It works fine but i cant find how to pass the Description of the image....
Can you give me a hint ?
Look the code ....
REPORT ZTEST2.
TYPE-POOLS: SBDST.
TABLES: STXBITMAPS.
CONSTANTS:
C_BDS_CLASSNAME TYPE SBDST_CLASSNAME VALUE 'DEVC_STXD_BITMAP',
C_BDS_CLASSTYPE TYPE SBDST_CLASSTYPE VALUE 'OT', " others
C_BDS_MIMETYPE TYPE BDS_MIMETP VALUE 'application/octet-stream',
C_BDS_ORIGINAL TYPE SBDST_DOC_VAR_TG VALUE 'OR'.
* Globals and globals for dynpro fields
DATA: G_OBJECTTYPE(20) TYPE C,
G_NEW_RESOLUTION LIKE STXBITMAPS-RESOLUTION,
G_STXBITMAPS TYPE STXBITMAPS,
G_STXH TYPE STXH,
G_TECHINFO TYPE RSSCG,
T_SIZE(40),
BDS_DESCRIPTION LIKE BAPISIGNAT-PROP_VALUE VALUE 'LALALA'.
CONSTANTS:
C_OBJECTTYPE_BDS LIKE G_OBJECTTYPE VALUE 'BDS',
C_OBJECTTYPE_STDTEXT LIKE G_OBJECTTYPE VALUE 'OBTEXT',
C_OBJECTTYPE_GRTEXT LIKE G_OBJECTTYPE VALUE 'OBGRAPHICS'.
DATA: P_FILENAME TYPE RLGRAP-FILENAME,
P_OBJECT TYPE STXBITMAPS-TDOBJECT,
P_ID TYPE STXBITMAPS-TDID,
P_BTYPE TYPE STXBITMAPS-TDBTYPE,
P_FORMAT TYPE C,
P_TITLE LIKE BDS_DESCRIPTION,
P_RESIDENT TYPE STXBITMAPS-RESIDENT,
P_AUTOHEIGHT TYPE STXBITMAPS-AUTOHEIGHT,
P_BMCOMP TYPE STXBITMAPS-BMCOMP.
DATA L_FILE TYPE STRING..
DATA: L_FILENAME TYPE STRING,
L_BYTECOUNT TYPE I,
L_BDS_BYTECOUNT TYPE I.
DATA: L_COLOR(1) TYPE C,
L_WIDTH_TW TYPE STXBITMAPS-WIDTHTW,
L_HEIGHT_TW TYPE STXBITMAPS-HEIGHTTW,
L_WIDTH_PIX TYPE STXBITMAPS-WIDTHPIX,
L_HEIGHT_PIX TYPE STXBITMAPS-HEIGHTPIX.
DATA: L_BDS_OBJECT TYPE REF TO CL_BDS_DOCUMENT_SET,
L_BDS_CONTENT TYPE SBDST_CONTENT,
L_BDS_COMPONENTS TYPE SBDST_COMPONENTS,
WA_BDS_COMPONENTS TYPE LINE OF SBDST_COMPONENTS,
L_BDS_SIGNATURE TYPE SBDST_SIGNATURE,
WA_BDS_SIGNATURE TYPE LINE OF SBDST_SIGNATURE,
L_BDS_PROPERTIES TYPE SBDST_PROPERTIES,
WA_BDS_PROPERTIES TYPE LINE OF SBDST_PROPERTIES.
DATA WA_STXBITMAPS TYPE STXBITMAPS.
PARAMETERS: P_FILE TYPE RLGRAP-FILENAME OBLIGATORY.
PARAMETERS: P_MATNR LIKE MARA-MATNR OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
FIELD_NAME = 'P_FILE'
IMPORTING
FILE_NAME = P_FILE.
START-OF-SELECTION.
DATA: P_NAMEX TYPE STXBITMAPS-TDNAME.
MOVE P_MATNR TO P_NAMEX.
DATA: FILELENGTH TYPE I.
DATA: BEGIN OF L_BITMAP OCCURS 0,
L(64) TYPE X,
END OF L_BITMAP.
L_FILE = P_FILE.
*SELECT SINGLE * FROM STXBITMAPS WHERE TDNAME = P_NAMEX.
* IF SY-SUBRC NE 0.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FILE
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = L_BYTECOUNT
TABLES
DATA_TAB = L_BITMAP
EXCEPTIONS
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
NO_BATCH = 1
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
* call method l_bds_object->get_info
* exporting
* classname = c_bds_classname
* classtype = c_bds_classtype
* object_key = l_object_key
* changing
* signature = l_bds_signature
* exceptions
* nothing_found = 1
* others = 2.
DATA: P_DOCID TYPE STXBITMAPS-DOCID.
DATA: P_RESOLUTION LIKE STXBITMAPS-RESOLUTION.
DATA: L_OBJECT_KEY TYPE SBDST_OBJECT_KEY.
CALL FUNCTION 'SAPSCRIPT_CONVERT_BITMAP_BDS'
EXPORTING
COLOR = 'X'
FORMAT = 'BMP'
RESIDENT = P_RESIDENT
BITMAP_BYTECOUNT = L_BYTECOUNT
COMPRESS_BITMAP = 'X'
IMPORTING
WIDTH_TW = L_WIDTH_TW
HEIGHT_TW = L_HEIGHT_TW
WIDTH_PIX = L_WIDTH_PIX
HEIGHT_PIX = L_HEIGHT_PIX
DPI = P_RESOLUTION
BDS_BYTECOUNT = L_BDS_BYTECOUNT
TABLES
BITMAP_FILE = L_BITMAP
BITMAP_FILE_BDS = L_BDS_CONTENT
EXCEPTIONS
FORMAT_NOT_SUPPORTED = 1
NO_BMP_FILE = 2
BMPERR_INVALID_FORMAT = 3
BMPERR_NO_COLORTABLE = 4
BMPERR_UNSUP_COMPRESSION = 5
BMPERR_CORRUPT_RLE_DATA = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
ENDIF.
CREATE OBJECT L_BDS_OBJECT.
WA_BDS_COMPONENTS-DOC_COUNT = '1'.
WA_BDS_COMPONENTS-COMP_COUNT = '1'.
WA_BDS_COMPONENTS-MIMETYPE = C_BDS_MIMETYPE."application/octet-stream
WA_BDS_COMPONENTS-COMP_SIZE = L_BDS_BYTECOUNT.
APPEND WA_BDS_COMPONENTS TO L_BDS_COMPONENTS.
WA_BDS_SIGNATURE-DOC_COUNT = '1'.
APPEND WA_BDS_SIGNATURE TO L_BDS_SIGNATURE.
L_OBJECT_KEY = P_NAMEX.
CALL METHOD L_BDS_OBJECT->CREATE_WITH_TABLE
EXPORTING
CLASSNAME = C_BDS_CLASSNAME "DEVC_STXD_BITMAP
CLASSTYPE = C_BDS_CLASSTYPE "OT
COMPONENTS = L_BDS_COMPONENTS
CONTENT = L_BDS_CONTENT
CHANGING
SIGNATURE = L_BDS_SIGNATURE
OBJECT_KEY = L_OBJECT_KEY
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC = 0.
READ TABLE L_BDS_SIGNATURE INDEX 1 INTO WA_BDS_SIGNATURE
TRANSPORTING DOC_ID.
IF SY-SUBRC = 0.
P_DOCID = WA_BDS_SIGNATURE-DOC_ID.
WA_STXBITMAPS-TDNAME = P_NAMEX.
WA_STXBITMAPS-TDOBJECT = 'GRAPHICS'.
WA_STXBITMAPS-TDID = 'BMAP'.
WA_STXBITMAPS-TDBTYPE = 'BCOL'.
WA_STXBITMAPS-DOCID = P_DOCID.
WA_STXBITMAPS-WIDTHPIX = L_WIDTH_PIX.
WA_STXBITMAPS-HEIGHTPIX = L_HEIGHT_PIX.
WA_STXBITMAPS-WIDTHTW = L_WIDTH_TW.
WA_STXBITMAPS-HEIGHTTW = L_HEIGHT_TW.
WA_STXBITMAPS-RESOLUTION = P_RESOLUTION.
WA_STXBITMAPS-RESIDENT = P_RESIDENT.
WA_STXBITMAPS-AUTOHEIGHT = P_AUTOHEIGHT.
WA_STXBITMAPS-BMCOMP = P_BMCOMP.
INSERT INTO STXBITMAPS VALUES WA_STXBITMAPS.
ENDIF.
ENDIF.
*--OAER
DATA: SIGN TYPE TABLE OF BAPISIGNAT WITH HEADER LINE,
COMP TYPE TABLE OF BAPICOMPON WITH HEADER LINE,
CONTENT TYPE TABLE OF BAPICONTEN WITH HEADER LINE,
CONTHEX TYPE TABLE OF SOLIX WITH HEADER LINE,
DOCID TYPE SOFOLENTI1-DOC_ID,
OBJKEY TYPE BAPIBDS01-OBJKEY,
DOC_DATA TYPE SOFOLENTI1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_FILE
FILETYPE = 'BIN'
TABLES
DATA_TAB = CONTENT.
BREAK FTELLI.
OBJKEY = P_NAMEX.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'BDS_DOCUMENTCLASS'.
SIGN-PROP_VALUE = DOC_DATA-OBJ_TYPE.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'BDS_CONTREP'.
SIGN-PROP_VALUE = ''.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'BDS_DOCUMENTTYPE'.
SIGN-PROP_VALUE = 'BDS_IMAGE'.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'BDS_TITLE'.
SIGN-PROP_VALUE = 'DIMITRIS'.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'DESCRIPTION'.
SIGN-PROP_VALUE = DOC_DATA-OBJ_DESCR.
APPEND SIGN.
SIGN-DOC_COUNT = '00000001'.
SIGN-PROP_NAME = 'LANGUAGE'.
SIGN-PROP_VALUE = SYST-LANGU.
APPEND SIGN.
COMP-DOC_COUNT = 1.
COMP-COMP_COUNT = 1.
* comp-comp_id = doc_data-obj_descr.
COMP-MIMETYPE = 'image/jpeg'.
COMP-COMP_SIZE = DOC_DATA-DOC_SIZE.
APPEND COMP.
CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREA_TAB'
EXPORTING
CLASSNAME = 'PICTURES'
CLASSTYPE = 'OT'
OBJECT_KEY = OBJKEY "p_matnr
TABLES
SIGNATURE = SIGN
COMPONENTS = COMP
CONTENT = CONTENT
EXCEPTIONS
NOTHING_FOUND = 1
PARAMETER_ERROR = 2
NOT_ALLOWED = 3
ERROR_KPRO = 4
INTERNAL_ERROR = 5
NOT_AUTHORIZED = 6
OTHERS = 7.
COMMIT WORK AND WAIT.
REFRESH: CONTENT, CONTHEX, SIGN, COMP.
Thanks a lot ....Hi,
You should be changing the URL passed to the URLRequest to
point to your server. Please check the URL from the HTML page
generated by your JSP and set the URLRequest URL accordingly.
Hope this helps. -
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 -
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 -
How to upload images to your own Web site?
I recently bought a Creative WebCam NX Pro. Installation was fine, the product works great.
The problem is that I want the cam to upload images to my own web site, www.fogwatch.com. This is basically a weather cam, with images uploading regularly.
The problem is that the Creative software creates a new name for the image file every time it uploads a new image -- 0.jpg, 02.jpg, 03.jpg, etc. The problem is that the HTML code on my Web site is programmed to recognize only one file name for the Web cam image -- image.jpg. With my old Logitech cam, the software would overwrite the old image with the new image with the same file name, and every was fine.
So, with the Creative software, I would have to change the file name in my HTML code every time the cam uploaded a new image?and that's impossible. I don't want to use the default Creative web page that it uploads images to as that doesn't fit in my site design.
Is anyone using a Creative camera to upload images to their own Web site? How are you doing it'sBcasey,
I spent some time working with Webcam monitor and have found the way to do what you are wanting. You need to set up your FTP settings, arrange for a continuous upload and then go over to the custom web page section. Put a checkmark in "upload custom webpage" and go to the section where it says how many pictures to display. Set this to and then remove the checkmark from "upload custom webpage". The program will now upload a single file called img.jpg updated at the interval you choose.
Jeremy -
Check if uploaded image is CMYK in ActionScript 3.0
Hey guys,
Is there any way to figure this out which user uploaded image in our flex project is RGB or CMYK?
Something like using byteArray and check the specific place of CMYK/RGB header on it...You need to test httpStatus of the URLLoader. Streaming
content undergoes a specific process when coming into Flash. The
only issue with httpStatus is that it does not work for every
browser....mostly Linux based systems and lesser programs on the
evolutionary food chain. I have not experienced problems with IE or
NS/FF on Vista at this point.
1. Send Request
2. Receive HTTP Status (HTTPStatusEvent.HTTP_STATUS)
3a. Status Good - Begin Load (Event.OPEN)
3b. Status Bad - 404 or Protected Filed
(IOErrorEvent.IO_ERROR)
4. Receive File - Downloading (ProgressEvent.PROGRESS)
5. Download Complete (Event.COMPLETE) -
Hi ,
I have uploaded image in AL11 and trying to link to thorough OA_UPLOAD_AND_LINK program. But when crosschecked it is existing there.
passed values in selection screen link below= >
while doing it an error is coming 'Either no file exists in the directory or the directory cannot be found'.
Directory is identified by program but file does not.
Any solution?
P.S. files are uploaded and saved in JPG formatTry to clear the flag "Processing in Front End", in this way the program will search for the file on application server and not from the front end.
Or select a file directly from your computer.
Regards. -
Canon 6d - LR4.3 64 bit - unable to upload images
Bought 6D. Can upload images to PS6 and Picassa but not to LR4.3. LRm.3 displays the images but when I got to import states it cannot read the files. Any suggestions will be greatly appreciated.
ThanksCheck your Destination specified in the LR import panel. Not reading the files that ACR and other programs can during an Import USUALLY means that the DESITNATION has a permissions issue, so the error message means “Cannot Write Destination Files” but the error message is generated when something in LR is trying to read the files in the destination and cannot.
-
Help in upload images???
hi every body!
please help me how can I upload images in a form from client to server???
and which class use to display images to jsp pages?
I try with ImageIcon but it didn't like I wish.
thanks in advancehi every body!
please help me how can I upload images in a form from
client to server???depends, there are MANY ways to move images across the network, but i think you are talking about an HTML form submitting to your web/j2ee server, if that's the case, i'd check out MultiPartRequest from O'Reilly
and which class use to display images to jsp pages?no class, JSP renders HTML, which is just text, you use <img src="blah.jpg">
I try with ImageIcon but it didn't like I wish.ImageIcon is great, but it's for GUI programming, not web pages
thanks in advance -
Hi,
In our portal service (SE80--> Internet Services) program how can I upload the image for our portal?
Saurabh GargHi Saurabh,
if you are trying to upload images from the web dyn pro side,
create a Java webdyn pro application with the images.
to place the picture in the application goto docs and settings->
<i>C:\Documents and Settings\arun.jacob\Documents\SAP\workspace\"yourapplication name"</i>
and once this is done. Upload the pAR file.
and on the iView side.
webdyn pro iView
select J2EE->IView from pAR
and once this is done. you can see the picture you included in the program.
Cheers -
hi,
i am confronting a problem how to upload image from local PC to web server . I am using Tomcat 4.0
please help me by sending code
thanksHi,
Here is the solution for uploading images and displaying images. I am using struts with JSP, so this code has a Action and ActionForm class. You can put the same code in Java Beans or Servlet class to run it. This code has two JSP files - one for Upload (upload.jsp)and other for Image(image.jsp) display. It has a Servlet also to display the image. Here is the code file wise.
Upload.jsp **********************************************************
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
<title>New Page 1</title>
</head>
<body>
<html:form action="uploadAction.do" enctype="multipart/form-data" method="POST">
<p>File to upload
<html:file property="fileUpload" size="20"/></p>
<p><html:submit value="Upload" property="upload"/></p>
<p> </p>
<p><html:img src="image.jsp"/></p>
<p> </p>
</html:form>
</body>
</html:html>
Image.jsp*****************************************************************
<jsp:useBean id="upload" class="uploadtest.uploadActionForm" scope="session">
</jsp:useBean>
<%
byte[] rgb=(byte[])session.getAttribute("byte");
request.setAttribute("byArr", rgb);
%>
<!--
The image data is now on the request object.
Forward the user to the showImage servlet.
That servlet will process and display the image data contained on the request object.
-->
Image is<p>
<jsp:forward page="/showimage" />
Struts Action Class - UploadAction.java **************************************************
import javax.servlet.http.*;
import java.io.*;
import org.apache.struts.upload.FormFile;
import org.apache.struts.action.*;
public class uploadAction extends Action {
public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
uploadActionForm upload = (uploadActionForm) actionForm;
try {
int size=upload.getFileUpload().getFileSize();
//if (image != null) {
byte[] byteArr = new byte[size];
//Create an input stream to read the uploaded file.
ByteArrayInputStream bytein = new ByteArrayInputStream(upload.getFileUpload().getFileData());
// Load the input stream into the byte Array.
bytein.read(byteArr);
// Close the input stream.
bytein.close();
// Load the byte[] into the content field.
upload.setContent(byteArr);
HttpSession ses=httpServletRequest.getSession();
ses.setAttribute("byte",byteArr);
return actionMapping.findForward("success");
} catch (Exception ex) {
ex.printStackTrace();
return actionMapping.findForward("success");
Struts ActionForm class ---uploadActionForm.java***************************************************
package uploadtest;
import org.apache.struts.action.*;
import org.apache.struts.upload.*;
import javax.servlet.http.*;
public class uploadActionForm extends ActionForm {
private FormFile fileUpload;
private byte[] content;
public FormFile getFileUpload() {
return fileUpload;
public void setFileUpload(FormFile fileUpload) {
this.fileUpload = fileUpload;
public byte[] getContent()
return content;
public void setContent(byte[] theFile)
this.content = theFile;
public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
/**@todo: finish this method, this is just the skeleton.*/
return null;
public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
Servlet to display image --- ShowImage.java ********************************************************
import java.io.*;
import java.util.*;
public class ShowImage extends HttpServlet {
//Initialize global variables
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
byte[] rgb = (byte[]) request.getAttribute("byArr");
if (rgb != null)
response.setContentType("image/gif");
OutputStream stream = response.getOutputStream();
stream.write(rgb);
else
response.setContentType("text");
response.getWriter().write("attribute byArr not found");
This code will enable to to upload and display the image. If you know Struts, then you can write the Struts-Config.xml file by yourself. Other wise write to me, I will send you that. If you want to save the image in database, then you have to keep it as BLOB datatype is database. For database you need to send the byte array in the uploadAction.java file to database. Database will keep the image as binary.
Thanks
Amit
Maybe you are looking for
-
Apache 2 and ~User Site folder
I recently installed Apache 2 following the helpful guide at http://www.phpmac.com/articles.php?view=244, at any rate while I have Apache running correctly, and can load http://127.0.0.1 (which displays the Apple default stuff) I cannot load http://1
-
Hi, I have the subreport calling from the main report. The subreport is based on MDX query agianst the SSAS cube. some dimensions in cube has values 0 and 1. when I try to pass '0' to the sub report as the parameter value, it gives an error "Data Ret
-
HT204394 Copy text to Keynote support please
Why can't I copy text from any doc into my Keynote presentation? Do I have to retype all the text again? Thanks
-
Simulation of high Portal application load
Hi all, does anybody has tested Portal environment using some external application simulating high usage of the server. I need to test my production environment before I will expose it for normal usage in my company. I will appreciate for anybody exp
-
Final Cut Express HD and virtual backgrounds
Can Final Cut Express HD use virtual backgrounds? If so, how is it done? MacBook Pro Mac OS X (10.4.8)