File upload with jsp

I am trying to upload a file to a mysql database (using a jsp tomcat 4.1 container) for each new member of my website (typically a cv which is a .rtf word file). I have used the example on the oreilly page and have managed to get the image of the file I have uploaded. Now I am trying to save this into my database for each member so that they can enter all of their details on the one page i.e. name age etc and also a browse for file button which will store the path of their file on their computer. When they click the submit button, all of their details are then stored into the database by the resultant page which outputs wehter they have been successful or not.
The upload bean code (from the oreilly site):
package com.idhcitip;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.ServletInputStream;
import java.util.Dictionary;
import java.util.Hashtable;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class FileUploadBean {
private String savePath, filepath, filename, contentType;
private Dictionary fields;
public String getFilename() {
return filename;
public String getFilepath() {
return filepath;
public void setSavePath(String savePath) {
this.savePath = savePath;
public String getContentType() {
return contentType;
public String getFieldValue(String fieldName) {
if (fields == null || fieldName == null)
return null;
return (String) fields.get(fieldName);
private void setFilename(String s) {
if (s==null)
return;
int pos = s.indexOf("filename=\"");
if (pos != -1) {
filepath = s.substring(pos+10, s.length()-1);
// Windows browsers include the full path on the client
// But Linux/Unix and Mac browsers only send the filename
// test if this is from a Windows browser
pos = filepath.lastIndexOf("\\");
if (pos != -1)
filename = filepath.substring(pos + 1);
else
filename = filepath;
private void setContentType(String s) {
if (s==null)
return;
int pos = s.indexOf(": ");
if (pos != -1)
contentType = s.substring(pos+2, s.length());
public void doUpload(HttpServletRequest request) throws IOException {
ServletInputStream in = request.getInputStream();
byte[] line = new byte[128];
int i = in.readLine(line, 0, 128);
if (i < 3)
return;
int boundaryLength = i - 2;
String boundary = new String(line, 0, boundaryLength); //-2 discards the newline character
fields = new Hashtable();
while (i != -1) {
String newLine = new String(line, 0, i);
if (newLine.startsWith("Content-Disposition: form-data; name=\"")) {
if (newLine.indexOf("filename=\"") != -1) {
setFilename(new String(line, 0, i-2));
if (filename==null)
return;
//this is the file content
i = in.readLine(line, 0, 128);
setContentType(new String(line, 0, i-2));
i = in.readLine(line, 0, 128);
// blank line
i = in.readLine(line, 0, 128);
newLine = new String(line, 0, i);
PrintWriter pw = new PrintWriter(new BufferedWriter(new
FileWriter((savePath==null? "" : savePath) + filename)));
while (i != -1 && !newLine.startsWith(boundary)) {
// the problem is the last line of the file content
// contains the new line character.
// So, we need to check if the current line is
// the last line.
i = in.readLine(line, 0, 128);
if ((i==boundaryLength+2 || i==boundaryLength+4) // + 4 is eof
&& (new String(line, 0, i).startsWith(boundary)))
pw.print(newLine.substring(0, newLine.length()-2));
else
pw.print(newLine);
newLine = new String(line, 0, i);
pw.close();
else {
//this is a field
// get the field name
int pos = newLine.indexOf("name=\"");
String fieldName = newLine.substring(pos+6, newLine.length()-3);
//System.out.println("fieldName:" + fieldName);
// blank line
i = in.readLine(line, 0, 128);
i = in.readLine(line, 0, 128);
newLine = new String(line, 0, i);
StringBuffer fieldValue = new StringBuffer(128);
while (i != -1 && !newLine.startsWith(boundary)) {
// The last line of the field
// contains the new line character.
// So, we need to check if the current line is
// the last line.
i = in.readLine(line, 0, 128);
if ((i==boundaryLength+2 || i==boundaryLength+4) // + 4 is eof
&& (new String(line, 0, i).startsWith(boundary)))
fieldValue.append(newLine.substring(0, newLine.length()-2));
else
fieldValue.append(newLine);
newLine = new String(line, 0, i);
//System.out.println("fieldValue:" + fieldValue.toString());
fields.put(fieldName, fieldValue.toString());
i = in.readLine(line, 0, 128);
} // end while
This works fine and I can access the image name of the file by using the commands in my jsp code(on the resultant page of the new member form):
<%@ page import="java.sql.*, com.idhcitip.*"%>
<jsp:useBean id="TheBean" scope="page" class="com.idhcitip.FileUploadBean" />
<%
TheBean.doUpload(request);
out.println("Filename:" + TheBean.getFilename());
So I am wondering how can I then store this image into a text blob in the database?
I found some code on the java.sun forum, but am not entirely sure how I am meant to use it?
package com.idhcitip;
import java.sql.*;
import java.io.*;
class BlobTest {
public static void main(String args[]) {
try {
//File to be created. Original file is duke.gif.
//DriverManager.registerDriver( new org.gjt.mm.mysql.Driver());
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
String host="localhost";
String user="root";
String pass="";
String db="idhcitip";
String conn;
// create connection string
conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user + "&password=" +
pass;
// pass database parameters to JDBC driver
Connection Conn = DriverManager.getConnection(conn);
// query statement
Statement SQLStatement = Conn.createStatement();
/*PreparedStatement pstmt = conn.prepareStatement("INSERT INTO BlobTest VALUES( ?, ? )" );
pstmt.setString( 1, "photo1");
File imageFile = new File("duke.gif");
InputStream is = new FileInputStream(imageFile);
pstmt.setBinaryStream( 2, is, (int)(imageFile.length()));
pstmt.executeUpdate();
PreparedStatement pstmt = Conn.prepareStatement("SELECT image FROM testblob WHERE Name = ?");
pstmt.setString(1, args[0]);
RandomAccessFile raf = new RandomAccessFile(args[0],"rw");
ResultSet rs = pstmt.executeQuery();
if(rs.next()) {
Blob blob = rs.getBlob(1);
int length = (int)blob.length();
byte [] _blob = blob.getBytes(1, length);
raf.write(_blob);
System.out.println("Completed...");
} catch(Exception e) {
System.out.println(e);
Once I have managed to store the file, I would just like people to be able to view each members profile and then to click on a link that will have their stored c.v.
Thanks for a reply anyone

You could do this one of two ways..
using a prepaired statment, you could read in a byte array...
String sql="INSERT INTO BlobTest VALUES( ? )";
PreparedStatement ps=con.prepareStatement(sql);
ps.setBytes(1, byte[]); //Your byte array buffer from your FileUploadBean
ps.executeUpdate();or you could just use the input stream..
String sql="INSERT INTO BlobTest VALUES( ? )";
PreparedStatement ps=con.prepareStatement(sql);
ps.setBinaryStream(1, InputStream, length); //You'll have to do some work to get length
ps.executeUpdate();

Similar Messages

  • File Upload with jsp & MultiPart

    Hi all,
    i've got a problem uploading a file from a multipart form.
    The file is correctly uploaded and i can open it, but I can't get the file name,
    In multipart.jsp fileName print out a null.
    Below the code. Can someone telle me where the error is?
    Thank's
    Kalvin
    this is the first page:
    prova.jsp:
    <form name="frmUp" action="multipart.jsp" method="POST" enctype="multipart/form-data">
    <input type="file" name="file"><br>
    <input type="submit">
    </form>
    multipart.jsp:
    <%
    String fileName = request.getParameter("nomeFile");
    String pathFile = "/myPath/";
    InputStream is = request.getInputStream();
    out.println("File name:"+fileName+"<br>");
    UploadFile uf = new UploadFile(pathFile, fileName);
    if (uf.upload(is))
         out.println("OK<br>");
    else
         out.println("NO OK <br>");
    %>

    you have to get the filename from UploadFile object probably. You definitely can't get it from request cuz multipart forms are handled specially. If it saves the file properly, then it's probably assuming a null filename means to use the name as it was uploaded, but UploadFile should be able to give you a File object for where the file was put.

  • File Uploading with two command button

    Hi all,
    After a long I return back.
    I am having a JSP page with some mandatory fields and one attach document field.
    I am using JSF framework so for file upload i used the tag <t:inputfileupload>, for compulsion fields I used the attribute required = true.
    My problem is,
    If i attach the file and click attach button before filling mandatory fields the action method is not called. Only after filling the mandatory fields the action method is called. What may be the reason for this?
    Is there any example for file uploading with in form and it has two separate command buttons?

    DHURAI wrote:
    Hi all,
    After a long I return back.
    I am having a JSP page with some mandatory fields and one attach document field.
    I am using JSF framework so for file upload i used the tag <t:inputfileupload>, for compulsion fields I used the attribute required = true.
    My problem is,
    If i attach the file and click attach button before filling mandatory fields the action method is not called. Only after filling the mandatory fields the action method is called. What may be the reason for this?My guess: you get validation errors, but you don't have a <h:messages/> in your JSF page so you don't see the error yourself. If you check your log files it will most likely be mentioned there.

  • File upload with 'asp vb' backend

    Hello,
    I am trying to get file uploading with flex (flash buider) working. There are plenty of examples with a php backend, but i need the script for a 'asp vb' backend.
    I' ve tried lots of different approaches but can't get it right. Someone out there with a solution?
    Thanx!!

    Believe it or not I have to do this also.
    I have legacy ASP code that uses ASPUpload that I'd like to get working with my Flash CS5 and FlashBuilder Burrito front-ends.
    it's just multipart encoded.
    So, if you first test it with ASPUpload and a simple form, trying just FILE1 first, and it works with ASP backend then tackle the FlashBuilder side with some debugging.
    ASPUpload is still an extremely embedded component on tens of thousands if not more sites, and it was just updated, but I think the previous version just before this update, the one that's out there in code on so many sites, that is what Flash needs to work with.
    ASPUpload is doing its part, as it follows all the multipart encoded RFC rules and has worked for years.
    I'd love to join you in finding out what's going on here.
    This is a long-standing issue.
    I've done PHP also.  But again, enhancing an interface with FlashBuilder4 or Burrito, to integrate with working legacy code makes it hard when something is not working on the Flash side (it appears anyway) as ASPUpload form posts are extremely easy.

  • Multiple File Upload With Metadata Using REST

    hi all
    I want to upload multiple files with metadata to document library using REST API. I am using this msdn article
    http://msdn.microsoft.com/en-us/library/office/dn769086(v=office.15).aspx for uploading file. I am able to upload single file to document library but it is not working for multiple file. when I select multiple file it is uploading last selected file. can
    anyone help with this. I am using office 365 environment.
    Thanks in advance

    Hi,
    According to your post, my understanding is that you wanted to use the REST to upload multiple files.
    Per my knowledge, the REST API is not supported for uploading multiple files via a single call.
    You can write your own loop to upload multiple files via an individual call.
    http://sharepoint.stackexchange.com/questions/108525/multiple-file-upload-with-metadata-using-rest/108532#108532
    More reference:
    http://sharepointfieldnotes.blogspot.com/2014/04/uploading-documents-and-setting.html
    http://www.shillier.com/archive/2013/03/26/uploading-files-in-sharepoint-2013-using-csom-and-rest.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Can anyone recommend a free file uploader with progress bar?

    Can anyone recommend a free file uploader with progress bar?
    I have searched google but with no luck.
    Ideally it would be a DW extension but that might be wishing
    for too much.
    I would like a large file limit for video and multiple file
    extensions allowed.
    Thanks in advance

    Heya,
    Check out this due Waleed he has some nice tuts and here's
    a
    link
    to file upload with progress bar tutorial he has. Granted it
    looks like it's just an animated gif letting users know their file
    is uploading; if you want realtime upload information displayed for
    the user you're gonna have to look at something like Flash with the
    power of actionscript to achieve that result.
    Hope that helps!

  • File upload with non-ascii name

    I'm designing a system that includes file-uploads. My problem is that any non-ascii chars in the filename are encoded strangely when saved. &auml; is encoded to a&#778; etc.
    I use Tomcat with the -Dfile.encoding="UTF-8" in the Catalina file. I get the same result despite method; my own implementation, apache commons or Javazoom's uploadBean. All the JSP charset parameters are set.
    Any ideas?

    Hi amitads,
    I'm sure u've used Java enough. Also, u must have learned about the \ (backslash) escape character ?
    So, if u want to include a string like a single quote, u can write \' and for a double quote u can write \".
    Try this ... I'm sure it will help.
    Keep me posted.
    Cheers !!
    Sherbir.

  • Error "PPE is working" on File Upload with Oracle Portlet running 10.1.2

    I am attempting to perform file upload using an Oracle Portlet running under the 10.1.2 Portal.
    All the examples I have seen indicate you must identify the encoding type as "multipart/form-data" in your JSP. When I do this and attempt to submit the page I get a blank screen with the words "PPE is working.".
    Looking at the "http-web-access.log" on my OC4J Standalone server I can see that the Standalone server never actually receives the request. For some reason it appears the Portal is not forwarding the request to OC4J like it is suppose to.
    Can someone tell me what might be wrong? Does anyone have experience implementing file upload using Oracle Portlets and the 10.1.2 Portal?
    Thanks,

    I have encountered the same problem 4 years before. Finally i figured out, Oracle Portal is not supporting "multipart/form-data".
    Work around is write a servlet program to upload the file into DB.
    This blog may help you.. http://bsubramaniam.blogspot.com/search/label/Java%20File%20Upload
    --Balaji S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Threading problem during File Upload with Apache faces upload tag

    First I am going to tell you "My Understanding of how JSF Apache Upload works, Correct me if i am wrong".
    1) Restores View (to show Input box and Browse button to facilitate users to select a file for upload)
    2) Translates Request Parameters to Component Values (Creates equivalent components to update them with request values).
    3) Validates Input(Checks to see whether the User has input the correct file)
    4) Updates Backing Bean or Model to reflect the values.
    5) Renders response to user.
    I am uploading huge files of sizes 400MB and above with the help of JSF apache extensions tag
    <h:form id="uploadForm" enctype="multipart/form-data">
    <x:inputFileUpload style="height:20px;" id="upload" value="#{backingbean.fileContents}" storage="file" size="50" />
    </h:form>
    In the backing bean
    private UploadedFile fileContents;
         public UploadedFile getFileContents() {
              return fileContents;
         public void setFileContents(UploadedFile fileContents) {
              System.out.println("File being uploaded...");
              this.fileContents = fileContents;
    Since, the file size is so huge, I am using temp folder to use for the apache tag instead of memory.
    In web.xml i am using like this
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>600m</param-value>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>10m</param-value>
    </init-param>
         <init-param>
    <param-name>uploadRepositoryPath</param-name>
    <param-value>/uploadfolder/</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    The upload process is working perfectly fine.
    Now coming to the problem:
    Suppose one user is logging into the application & uploading say 400MB of files.
    Until these files are linked to the model objects as my understanding of step 2, if second user tries to open the application he gets stuck with the loading page.
    The page gets loaded only after the request files are linked to the component values(Step 2 above) and updates the backing bean's values.
    I don't see any error in the logs. User is getting stuck. The user is getting stuck only when uploading the files. The other operations like searching are not blocking any other activities performed by the user.
    Server used: IBM Application Server V6.0. CPU is normal, memory usage is normal.

    Dear friend,
    i am also trying to upload using the common file upload.
    when try to run the file error is coming
    can give some suggestion.
    can i use if concurrent user file upload at a time

  • Javascript multiple file upload with progressbar does not work in firefox, please help

    I want to upload files using this javascript snipped as well as processing non file fields on the same form. This works beautiful in IE11, Chrome and Opera, but not in firefox (version 34).
    I fired the non file handler with the action attribute on the <form> like this:
    <form id="upload_form" enctype="multipart/form-data" method="POST" action="nonFile.php">
    and the javascript with:
    <input name="submit" type="submit" style="background: green" value="Submit" onclick="return uploadFiles()"/>
    When I change type="button" the file uploads work in FF but the I have no control over the non file fileds.
    Can someone gives me an indication of what is wrong?
    oXHR.upload.addEventListener("progress", function(e){
    var percent=(e.loaded/e.total) * 100;
    _(idProg).value = Math.round(percent);
    _(idstat).innerHTML = filename.name + " "+Math.round(percent)+"% --- Please Wait";
    }, false);
    // Upload finish, show the size of the file in Bytes, KBytes or MBytes
    oXHR.onreadystatechange = function(){
    if (oXHR.readyState == 4 && oXHR.status == 200){
    var iBytesTransfered = bytesToSize(filesize);
    _(idstat).innerHTML = filename.name + " Size: " + iBytesTransfered + " "+100+"%";
    _(idProg).value = 100;
    // Upload failed
    oXHR.addEventListener("error", function(e){
    _(idstat).innerHTML = "Upload Failed";
    }, false);
    // Upload aborted
    oXHR.addEventListener("abort", function(e){
    _(idstat).innerHTML = "Upload Aborted";
    }, false)

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0, 0,0" width="600" height="360">
    <param name=movie value="example.swf">
       <param name="allowScriptAccess" value="always" />
    <param name="quality" value="high">
    <param name="allowScript" value="opaque">
    <param name="wmode" value="opaque">
    <embed src="example.swf" quality="high" allowScriptAccess="always" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Shockwave Flash" type="application/x-shockwave-flash" width="600" height="360"></embed></object>

  • File upload with DAD not working

    Hi all,
    I have an application which uses the file upload function, similar to the sample http://otn.oracle.com/products/database/htmldb/howtos/howto_file_upload.html
    During the development I was not using a DAD and it was working perfectly. Now I have changed the application to use a DAD and now the file upload fails with a HTTP 404 - File not found error
    [DAD_din]
    connect_string = deccasm01os.na.decoma.com:1521:DIN
    ;password =
    ;username =
    ;default_page =
    document_table = wwv_flow_file_objects$
    document_path = docs
    document_proc = wwv_flow_file_mgr.process_download
    ;upload_as_long_raw =
    ;upload_as_blob =
    ;name_prefix =
    ;always_describe =
    ;after_proc =
    ;before_proc =
    reuse = Yes
    ;connmax =
    ;pathalias =
    ;pathaliasproc =
    enablesso = No
    ;sncookiename =
    stateful = STATELESS_RESET
    ;custom_auth =
    response_array_size = 128
    ;exclusion_list =
    ;cgi_env_list =
    bind_bucket_widths = 32,128,1450,2048,4000
    bind_bucket_lengths = 4,20,100,400
    ;error_style =
    ;nls_lang =
    BTW, it is on HTMLDB v1.6 on 9iDB (9.2.0.4)
    thx

    Rob,
    The File Browse item type does not require upload table WWV_FLOW_FILE_OBJECTS$. The POST for the File Browse item type is intercepted by modplsql and is inserted into the Document Table as defined by the Database Access Descriptor.
    You could ultimately create your own DAD with your own Document Table. The Document Table would have to contain the minimum definition as described at:
    http://download-west.oracle.com/docs/cd/B14099_03/web.1012/b14010/concept.htm#i1005880
    This way, users of the application using the Basic Database Authenticated DAD would be uploading directly into your table and not the HTML DB one. A word of caution, though, is that you would never want to use this DAD with HTML DB development itself...you would need to use the DAD that specifies upload into WWV_FLOW_FILE_OBJECTS$ for HTML DB development.
    I hope this helps.
    Joel

  • Emulating HTTP POST for file upload with J2ME

    I have search through a lot of site and couldn't find the actual code. I try to emulate below html with J2ME.
    <form method="POST" enctype="multipart/form-data" action="Insert.asp">
    <td>File :</td><td>
    <input type="file" name="file" size="40"></td></tr>
    <td> </td><td>
    <input type="submit" value="Submit"></td></tr>
    </form>
    here is my code :
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    byte[] filecontent = file byte content ...
    try {
    c = (HttpConnection)Connector.open("http://xx.com/insert.asp");
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("Content-Length", String.valueOf(cmg.length + 15));
    c.setRequestProperty("Content-type","multipart/form-data");
    os = c.openOutputStream();
    os.write("file=c:\\abc.png".getBytes());
    os.write(filecontent);
    os.flush();
    I can emulate form with text field and it work, but when it come to file upload, above code not working, I don't know what to put for the outputstream, filename ? content ? or both ? since the html only has one field that is the "file" field. The file is actually store in rms with filename abc.png, and I just put in the c:\ for the server as a dump path.

    File upload is more complicated then that... you need multi-part MIME formatting.... But I have just the code...
    http://forum.java.sun.com/thread.jspa?forumID=256&threadID=451245

  • WSRP File Upload with Struts

    Hello there
    I've been trying to integrate with WSRP a Struts 1.1 web app which provides a simple File Upload functionality.
    It works fine as a standalone web application (direct access to the web app).
    But I can't get it to work through WSRP from BEA Weblogic Portal 8.1SP4 to BEA Weblogic Server 8.1SP4.
    I followed all the steps indicated at http://e-docs.bea.com/wlp/docs81/wsrp/workprod.html#1010271.
    Plus I set up the wsrp-producer-config.xml file to handle attachments as follows:
    <markup secure="false" rewrite-urls="true" transport="attachment" accepts-mime="true"/>
    The start page of the portlet displays fine on the Consumer side.
    But upon file upload it never reaches the actual Struts Action on the Producer side.
    No error is displayed either on the Consumer or on the Producer side but the file does not get uploaded.
    Any idea why ?
    Am I missing anything in the configuration ?
    Thanks
    Patrick
    ==================================
    All I get in the Producer logs is
    <6-mar-2006 18.30.32 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP request from/to 10.102.194.96>
    <6-mar-2006 18.30.32 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP response from/to 10.102.194.96>
    <6-mar-2006 18.30.33 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP request from/to 10.102.194.96>
    <6-mar-2006 18.30.33 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP response from/to 10.102.194.96>
    <6-mar-2006 18.30.33 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP request from/to 10.102.194.96>
    <6-mar-2006 18.30.33 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP response from/to 10.102.194.96>
    ========
    For info here's the Request from the monitor:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <urn:performBlockingInteraction xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
    <urn:registrationContext xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    <urn:portletContext>
    <urn:portletHandle>stdgui243 portlet</urn:portletHandle>
    </urn:portletContext>
    <urn:runtimeContext>
    <urn:userAuthentication>wsrp:none</urn:userAuthentication>
    <urn:portletInstanceKey>T8005</urn:portletInstanceKey>
    <urn:namespacePrefix>T8005</urn:namespacePrefix>
    <urn:sessionID>GMlX1KDR8G2dTCHX12FLZy2htBzz5rsTy9H592pWMx0YBtthZgfs!-383570453</urn:sessionID>
    <urn:extensions>
    <urn1:LookAndFeelDescriptor xmlns:urn1="urn:bea:wsrp:ext:v1:types">
    <urn1:skeletonId>default</urn1:skeletonId>
    <urn1:skeletonPath>/framework/skeletons/</urn1:skeletonPath>
    <urn1:skinId>avitek</urn1:skinId>
    <urn1:skinPath>/framework/skins/</urn1:skinPath>
    </urn1:LookAndFeelDescriptor>
    </urn:extensions>
    </urn:runtimeContext>
    <urn:userContext xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    <urn:markupParams>
    <urn:secureClientCommunication>false</urn:secureClientCommunication>
    <urn:locales>it</urn:locales>
    <urn:mimeTypes>text/html</urn:mimeTypes>
    <urn:mimeTypes>image/gif</urn:mimeTypes>
    <urn:mimeTypes>image/x-xbitmap</urn:mimeTypes>
    <urn:mimeTypes>image/jpeg</urn:mimeTypes>
    <urn:mimeTypes>image/pjpeg</urn:mimeTypes>
    <urn:mimeTypes>application/x-shockwave-flash</urn:mimeTypes>
    <urn:mimeTypes>application/vnd.ms-powerpoint</urn:mimeTypes>
    <urn:mimeTypes>application/vnd.ms-excel</urn:mimeTypes>
    <urn:mimeTypes>application/msword</urn:mimeTypes>
    <urn:mimeTypes>*/*</urn:mimeTypes>
    <urn:mode>wsrp:view</urn:mode>
    <urn:windowState>wsrp:normal</urn:windowState>
    <urn:clientData>
    <urn:userAgent>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</urn:userAgent>
    </urn:clientData>
    <urn:navigationalState/>
    <urn:markupCharacterSets>UTF-8</urn:markupCharacterSets>
    <urn:markupCharacterSets>UTF-8</urn:markupCharacterSets>
    </urn:markupParams>
    <urn:interactionParams>
    <urn:portletStateChange>readOnly</urn:portletStateChange>
    <urn:interactionState>action=%2Fstdgui243%2Fupload%26module=%2Fstdgui243</urn:interactionState>
    </urn:interactionParams>
    </urn:performBlockingInteraction>
    </soapenv:Body>
    </soapenv:Envelope>

    Hi Patrick,
    Can you try this without accept-mime attribute?
    Subbu
    >
    I've been trying to integrate with WSRP a Struts 1.1 web app which provides a simple File Upload functionality.
    It works fine as a standalone web application (direct access to the web app).
    But I can't get it to work through WSRP from BEA Weblogic Portal 8.1SP4 to BEA Weblogic Server 8.1SP4.
    I followed all the steps indicated at http://e-docs.bea.com/wlp/docs81/wsrp/workprod.html#1010271.
    Plus I set up the wsrp-producer-config.xml file to handle attachments as follows:
    <markup secure="false" rewrite-urls="true" transport="attachment" accepts-mime="true"/>
    The start page of the portlet displays fine on the Consumer side.
    But upon file upload it never reaches the actual Struts Action on the Producer side.
    No error is displayed either on the Consumer or on the Producer side but the file does not get uploaded.
    Any idea why ?
    Am I missing anything in the configuration ?
    Thanks
    Patrick
    ==================================
    All I get in the Producer logs is
    <6-mar-2006 18.30.32 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP request from/to 10.102.194.96>
    <6-mar-2006 18.30.32 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP response from/to 10.102.194.96>
    <6-mar-2006 18.30.33 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP request from/to 10.102.194.96>
    <6-mar-2006 18.30.33 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP response from/to 10.102.194.96>
    <6-mar-2006 18.30.33 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP request from/to 10.102.194.96>
    <6-mar-2006 18.30.33 CET> <Debug> <WSRP-Consumer> <BEA-420550> <SOAP response from/to 10.102.194.96>
    ========
    For info here's the Request from the monitor:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <urn:performBlockingInteraction xmlns:urn="urn:oasis:names:tc:wsrp:v1:types">
    <urn:registrationContext xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    <urn:portletContext>
    <urn:portletHandle>stdgui243 portlet</urn:portletHandle>
    </urn:portletContext>
    <urn:runtimeContext>
    <urn:userAuthentication>wsrp:none</urn:userAuthentication>
    <urn:portletInstanceKey>T8005</urn:portletInstanceKey>
    <urn:namespacePrefix>T8005</urn:namespacePrefix>
    <urn:sessionID>GMlX1KDR8G2dTCHX12FLZy2htBzz5rsTy9H592pWMx0YBtthZgfs!-383570453</urn:sessionID>
    <urn:extensions>
    <urn1:LookAndFeelDescriptor xmlns:urn1="urn:bea:wsrp:ext:v1:types">
    <urn1:skeletonId>default</urn1:skeletonId>
    <urn1:skeletonPath>/framework/skeletons/</urn1:skeletonPath>
    <urn1:skinId>avitek</urn1:skinId>
    <urn1:skinPath>/framework/skins/</urn1:skinPath>
    </urn1:LookAndFeelDescriptor>
    </urn:extensions>
    </urn:runtimeContext>
    <urn:userContext xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
    <urn:markupParams>
    <urn:secureClientCommunication>false</urn:secureClientCommunication>
    <urn:locales>it</urn:locales>
    <urn:mimeTypes>text/html</urn:mimeTypes>
    <urn:mimeTypes>image/gif</urn:mimeTypes>
    <urn:mimeTypes>image/x-xbitmap</urn:mimeTypes>
    <urn:mimeTypes>image/jpeg</urn:mimeTypes>
    <urn:mimeTypes>image/pjpeg</urn:mimeTypes>
    <urn:mimeTypes>application/x-shockwave-flash</urn:mimeTypes>
    <urn:mimeTypes>application/vnd.ms-powerpoint</urn:mimeTypes>
    <urn:mimeTypes>application/vnd.ms-excel</urn:mimeTypes>
    <urn:mimeTypes>application/msword</urn:mimeTypes>
    <urn:mimeTypes>*/*</urn:mimeTypes>
    <urn:mode>wsrp:view</urn:mode>999
    <urn:windowState>wsrp:normal</urn:windowState>
    <urn:clientData>
    <urn:userAgent>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)</urn:userAgent>
    </urn:clientData>
    <urn:navigationalState/>
    <urn:markupCharacterSets>UTF-8</urn:markupCharacterSets>
    <urn:markupCharacterSets>UTF-8</urn:markupCharacterSets>
    </urn:markupParams>
    <urn:interactionParams>
    <urn:portletStateChange>readOnly</urn:portletStateChange>
    <urn:interactionState>action=%2Fstdgui243%2Fupload%26module=%2Fstdgui243</urn:interactionState>
    </urn:interactionParams>
    </urn:performBlockingInteraction>
    </soapenv:Body>
    </soapenv:Envelope>

  • Dreamweaver files upload with zero filesize

    Hi,
    I have created a site using Dreamweaver CS6 and have come to upload it. I entered the FTP details and set it going. (Incidentally, is there a way you can get only files that are actually used in the site to upload, rather than everything you have in the site folder?) However, it seemed to be going very slowly, so I switched over to FileZilla, which I have previously found to be quite quick. Here, the connection appears to timeout so the upload is attempted repeatedly, and when it gives up retrying the selected file shows on the server but with a file size of 0.
    Several emails to the hosting company, and a bit of trial-and-error later, it seems that it is only files that come under the umbrella of this Dreamweaver site which will not upload properly. If I select a random file from my desktop, it will upload to the same server, indicating there is nothing wrong with my username/password, ports etc.
    Why would it be that only my Dreamweaver files will not upload? It is not limited to html files. jpg files won't upload either. Even jpg's which are not linked to but still in the site folder will not upload!
    Any insight would be greatly appreciated, as I would like to put this project to bed!
    Many thanks,
    David

    Can you upload these files to this site with DW (albeit slowly)?
    No. With DW or FZ, to this server, the result is the same. DW just sits there saying 0 of 1 completed (or words to that effect) (since I established this is faulty I've only being trying single files, not the whole site.)
    Can you upload files to other sites with DW and if so, is the result different?
    Yes. If I enter details for another server DW and FZ will upload this site's files with no issue whatsoever.
    FileZilla is not able to upload any files that come from DW at all?
    No. FZ will upload this site's files created in DW to the second server.
    If you put an external file that you *can* upload with FileZilla into a DW site, can you then upload it with DW?  Or with FileZilla?
    I copied index.html from the site folder onto the desktop, FZ still didn't want to know. I copied the random photo.jpg into the site folder, and that stopped uploading too. However, now whether from the desktop or the site folder, this jpg (and also another, which happened to be sat next to it on the desktop) now stop uploading at 262,144 bytes. Obviously the html files are much smaller at around 7-10kB so it can't be a max file size thing, and anyway a 1.5MB jpg was no problem yesterday.
    Are you working within a defined site in DW?
    Yes.
    Do the site files reside on your local hard drive or an external drive?
    Local hard drive.
    Which operating system do you use?
    Yesterday, Mac OS X 10.7; today 10.8.

  • File uploading in jsp

    this is rambabu,
    i am new to fileuploading concepts. any body help me how to upload a file .please send me the code to mail.my mail id is
    [email protected]

    Jakarta Commons File Upload.
    search, read, use.
    and FYI... posting your email address is a sure-fire way to get yourself on more spam mailing lists, but hey.. maybe you like spam.

Maybe you are looking for