HTTP Upload Problem

I have an JSP application that uses a JSP component to upload files onto any location on the web server. The component has a saveAs method to save the file on the web server. This functionality works great on the iFS Apache Server(solaris). It will not work when I save the file to an IFS folder. No error message. I am creating a XML file (that contains Custom Document Class) on the fly in my JSP. Ideally I would like to save it to iFS and have it automatically parsed.
I check my ACLs for the iFS destination folder (set to Public).
What would be the best way to get my documents into iFS given the scenerio described above.
null

Neil
I'm not sure I understand your applicaiton. From your description it appears that your JSP is able to successfully navigate the Unix Directory and save the files on the Unix File System - is this correct ?
Now you appear to be trying to use the save application to navigate the iFS Folder Heirarchy and save files there. Since it is not currently possible to expose the iFS Folder Hierarchy as a Unix File System you will need to write a totally seperate set of logic that will use the iFS Java API to navigate the iFS Folder Heirarchy and to accept the input stream containing the uploaded document.
This would require a completely different JSP to one which browses the native file system. This would be similar to the Upload via Browse function of the standard iFS WebUI

Similar Messages

  • Uploading problem with Ebay and Dreamweaver MX

    I am unable to sync websites with Dreamweaver MX 6.01. When I connect to the remote server, it shuts down the program. I have reinstalled the program, but it still does it. Also, when I use Safari, Opera, and Firefox to upload photos on Ebay, the upload process fails completely, and blows me directly into My Ebay, as if I was not on the selling page at all. I have to go to my PC to do the photo uploads. Seems like it may be a related issue, some kind of uploading problem with Rosetta, or something. I am using a Macbook Pro with the 2.0Ghz processor, connected with ethernet cable, and firewall is set to off. Any ideas?

    For E-Bay you might try the following:
    Type the following command in Terminal (while Safari is NOT running):
    defaults write com.apple.Safari IncludeDebugMenu 1
    Then launch Safari, and you will be able to use the new Debug menu.
    If you ever wish to disable it again, just repeat the command with a "0" instead of a "1".
    Under the Debug menu, you'll see the User Agent sub-menu; select Windows MSIE 6.0 from the list and then try connecting to your web site
    Dreamweaver you might need to update your version.
    To Dreamweaver 8.01
    http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=f56452a8

  • Uploading problems with Safari 4.1.3 -

    Hello, I just thought this was a funny question to ask -
    On my PowerPC G5 tower, running OS 10.4.11, and my question is in regards to Safari version 4.1.3 uploading problems for facebook and youtube... I always have to use FireFox version 3.6.13... and not without trouble either.
    I get it.  I need a new computer, but I just thought it fascinating why one works 90% of the time and the other never works.

    Firefox is way more upto date than Safari in 10.4.11, but TenFourFox is the most up to date browser for our PPCs, they even have G4 & G5 optimized versions...
    http://www.floodgap.com/software/tenfourfox/
    Also I think they Require Flash &/or Java, which may be a problem in 10.4

  • Mark's Drakes HTTP upload example

    Mark,
    With reference to your fine http upload example posted in march 9th...
    I've tried compiling your example as a starting point in JDeveloper and I have encountered two problems.
    1. The class ifs.pm.xml.attributes.XmlConstants appears to be missing. Please can you make this class available.
    2. I've defined a new library in JDeveloper pointing at the 1.1.9.0.7 ifs library files but oracle.ifs.adk.http.HttpUtils continues to be unrecognised. I have even tried replacing the lib directory in the JDeveloper directory tree. What am I missing here? Do I have the right ifs upload - there was no previous installation on the PC i'm using and I downloaded ifs fresh at the start of the week.
    thanks,
    Dinyar 'JRookie' Cooper

    Here's an updated RendererUtilties that does not require XmlConstants...
    // $Header$
    * Please complete these missing tags
    * @author
    * @rref
    * @copyright
    * @concurrency
    * @see
    package ifs.pm.common.renderer;
    import ifs.pm.common.trace.Alert;
    import java.util.Hashtable;
    import java.util.Vector;
    import oracle.ifs.beans.ValueDefault;
    import oracle.ifs.beans.ValueDefaultDefinition;
    import oracle.ifs.beans.ValueDefaultPropertyBundle;
    import oracle.ifs.beans.ValueDefaultPropertyBundleDefinition;
    import oracle.ifs.server.S_ValueDefault;
    import oracle.ifs.server.S_PublicObject;
    import oracle.ifs.server.S_Document;
    import oracle.ifs.server.S_Folder;
    import oracle.ifs.server.S_PropertyBundle;
    import oracle.ifs.server.S_Property;
    import oracle.ifs.server.S_Attribute;
    import oracle.ifs.server.S_ValueDefaultPropertyBundle;
    import oracle.ifs.beans.Property;
    import oracle.ifs.beans.PropertyDefinition;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.beans.Folder;
    import oracle.ifs.beans.PropertyBundle;
    import oracle.ifs.beans.PropertyBundleDefinition;
    import oracle.ifs.beans.Attribute;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.server.S_LibrarySession;
    import oracle.ifs.beans.ClassObject;
    import oracle.ifs.beans.LibraryObject;
    import oracle.ifs.server.S_ClassObject;
    import oracle.ifs.server.S_LibraryObject;
    import oracle.ifs.common.AttributeValue;
    import oracle.ifs.common.LibrarySessionInterface;
    import oracle.ifs.common.LibraryObjectInterface;
    import oracle.ifs.common.IfsException;
    import oracle.ifs.common.Collection;
    // import ifs.pm.xml.attributes.XmlConstants;
    public class RendererUtilities
    public static final String CONFIGURATION = "IFS.RENDERER.RendererConfiguration";
    public static final String EXCLUDE_CLASS = "IFS.RENDERER.EXCLUDE";
    public static final String INCLUDE_ATTRIBUTES = "IFS.RENDERER.INCLUDE";
    public static final String INLINE_RENDERING = "IFS.RENDERER.INLINE";
    public static final String CDATA_LIST = "IFS.RENDERER.CDATA";
    public static final String DATATYPE_REFERENCE = "datatype";
    public static final String CLASSNAME_REFERENCE = "classname";
    public static final String TYPE_REFERENCE = "reftype";
    public static final String FORMAT_REFERENCE = "format";
    public static final String PATH_REFERENCE = "path";
    public static final String OBJECTID_REFERENCE = "id";
    public static final String NAME_REFERENCE = "name";
    public static final String REFERENCE_TYPE_PROPERTY = "REFERENCETYPE";
    public static final String REFERENCE_ATTRIBUTE_PROPERTY = "UNIQUEATTRIBUTE";
    public static final String OPERATIONS = "OPERATIONS";
    public static final String TARGETS = "TARGETS";
    private static final boolean DEBUG = true;
    private static S_ValueDefault m_RendererConfiguration;
    * Please complete the missing tags for getAttributes
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static AttributeValue [] getAttributes( LibraryObjectInterface loi )
    throws IfsException
    String [] attributeNames = getAttributeNames( loi );
    AttributeValue [] attributeValues = new AttributeValue [ attributeNames.length ];
    if( loi instanceof LibraryObject )
    LibraryObject lo = ( LibraryObject ) loi;
    for( int i = 0; i < attributeNames.length; i++ )
    attributeValues [ i ] = lo.getAttribute( attributeNames [ i ] );
    else
    S_LibraryObject lo = ( S_LibraryObject ) loi;
    for( int i = 0; i < attributeNames.length; i++ )
    attributeValues [ i ] = lo.getAttribute( attributeNames [ i ] );
    return attributeValues;
    * Please complete the missing tags for getAttributeNames
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static String [] getAttributeNames( LibrarySessionInterface ifs, ClassObject co )
    throws IfsException
    // Public so it Can be used by the HttpUploadBean....
    // Find the Renderinbg Rules for this class or one of it's super Class
    PropertyBundle renderingRules = getRenderingRules( ifs, co );
    if( null != renderingRules )
    // RenderingRules defined for this Class Object
    // Check if an Exclude Class is defined....
    String [] attributeNames;
    AttributeValue av = renderingRules.getPropertyValue( EXCLUDE_CLASS );
    if( av != null )
    // Exclude Class is defined. Render attributes defined by Subclasses of Exclude Class
    Attribute [] attributes = new Attribute [ 0 ];
    if( av.getDataType() == Attribute.ATTRIBUTEDATATYPE_STRING )
    // Special Case.. Allows user to Define LibraryObject as the Exclude Class. If the Exclude
    // Class is a String simple Render all Attributes of the target Object.
    if( DEBUG )
    Alert.log( "RendererUtilities.getAttributeNames: Exclude Class defined as LibraryObject." );
    attributes = co.getEffectiveClassAttributes();
    else
    ClassObject excludeClass = ( ClassObject ) av.getSchemaObject( ifs );
    if( DEBUG )
    Alert.log( "RendererUtilities.getAttributeNames: Exclude Class defined as " + excludeClass.getName() );
    attributes = co.getExtendedClassAttributes( excludeClass );
    attributeNames = getAttributeNames( attributes );
    else
    // No Exclude Class defined. Render extended Attributes defined by this Class Object.
    attributeNames = getExtendedAttributes( co );
    String [] exceptionList = new String [ 0 ];
    av = renderingRules.getPropertyValue( INCLUDE_ATTRIBUTES );
    if( av != null )
    // Add the Exception List to the List of Attributes to be Rendered
    exceptionList = av.getStringArray( ifs );
    attributeNames = mergeLists( attributeNames, exceptionList );
    return attributeNames;
    else
    // No Renderer Configuration defined for this Class Object: Render Extended Attributes defined by this ClassObject
    if( DEBUG )
    Alert.log( "RendererUtilities.getAttributeNames: No RendererConfiguration for this class: Rendering Extended Attributes" );
    return getExtendedAttributes( co );
    * Please complete the missing tags for getClassObjectName
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static String getClassObjectName( LibraryObjectInterface loi )
    throws IfsException
    if( loi instanceof LibraryObject )
    LibraryObject lo = ( LibraryObject ) loi;
    return lo.getClassObject().getName();
    else
    S_LibraryObject lo = ( S_LibraryObject ) loi;
    return lo.getClassObject().getName();
    * Please complete the missing tags for getObjectReference
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static Hashtable getObjectReference( LibraryObjectInterface loi )
    throws IfsException
    if( loi instanceof LibraryObject )
    LibraryObject lo = ( LibraryObject ) loi;
    return getObjectReference( loi.getSessionInterface(), lo.getClassObject() );
    else
    S_LibraryObject lo = ( S_LibraryObject ) loi;
    return getObjectReference( loi.getSessionInterface(), lo.getClassObject() );
    * Please complete the missing tags for getObjectReference
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static Hashtable getObjectReference( LibrarySessionInterface ifs, S_ClassObject co )
    throws IfsException
    String classObjectName = co.getName();
    if( DEBUG )
    Alert.log( "RendererUtilities.getObjectReference: Processing Class " + classObjectName );
    S_PropertyBundle renderingRules = getRenderingRules( ifs, co );
    if( null != renderingRules )
    AttributeValue av = renderingRules.getPropertyValue( INLINE_RENDERING );
    if( av != null )
    // An INLINE Rendering Policy is defined for this Class.
    Hashtable inlinePolicyDefn = new Hashtable();
    inlinePolicyDefn.put( REFERENCE_TYPE_PROPERTY, OBJECTID_REFERENCE );
    S_PropertyBundle inlineRendering = ( S_PropertyBundle ) av.getPublicObject( ifs );
    av = inlineRendering.getPropertyValue( REFERENCE_TYPE_PROPERTY );
    String referenceType = av.getString( ifs );
    if( referenceType.equalsIgnoreCase( CLASSNAME_REFERENCE ) )
    // Render by Reference
    av = inlineRendering.getPropertyValue( REFERENCE_ATTRIBUTE_PROPERTY );
    String referenceAttribute = av.getString( ifs );
    inlinePolicyDefn = new Hashtable();
    inlinePolicyDefn.put( REFERENCE_TYPE_PROPERTY, CLASSNAME_REFERENCE );
    inlinePolicyDefn.put( CLASSNAME_REFERENCE, classObjectName );
    inlinePolicyDefn.put( TYPE_REFERENCE, referenceAttribute );
    if( referenceType.equalsIgnoreCase( PATH_REFERENCE ) )
    inlinePolicyDefn = new Hashtable();
    inlinePolicyDefn.put( REFERENCE_TYPE_PROPERTY, PATH_REFERENCE );
    return inlinePolicyDefn;
    return null;
    * Please complete the missing tags for getObjectReference
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static Hashtable getObjectReference( LibrarySessionInterface ifs, ClassObject co )
    throws IfsException
    String classObjectName = co.getName();
    if( DEBUG )
    Alert.log( "RendererUtilities.getObjectReference: Processing Class " + classObjectName );
    PropertyBundle renderingRules = getRenderingRules( ifs, co );
    if( null != renderingRules )
    AttributeValue av = renderingRules.getPropertyValue( INLINE_RENDERING );
    if( av != null )
    // An INLINE Rendering Policy is defined for this Class.
    Hashtable inlinePolicyDefn = new Hashtable();
    inlinePolicyDefn.put( REFERENCE_TYPE_PROPERTY, OBJECTID_REFERENCE );
    PropertyBundle inlineRendering = ( PropertyBundle ) av.getPublicObject( ifs );
    av = inlineRendering.getPropertyValue( REFERENCE_TYPE_PROPERTY );
    String referenceType = av.getString( ifs );
    if( referenceType.equalsIgnoreCase( CLASSNAME_REFERENCE ) )
    // Render by Reference
    av = inlineRendering.getPropertyValue( REFERENCE_ATTRIBUTE_PROPERTY );
    String referenceAttribute = av.getString( ifs );
    inlinePolicyDefn = new Hashtable();
    inlinePolicyDefn.put( REFERENCE_TYPE_PROPERTY, CLASSNAME_REFERENCE );
    inlinePolicyDefn.put( CLASSNAME_REFERENCE, classObjectName );
    inlinePolicyDefn.put( TYPE_REFERENCE, referenceAttribute );
    if( referenceType.equalsIgnoreCase( PATH_REFERENCE ) )
    inlinePolicyDefn = new Hashtable();
    inlinePolicyDefn.put( REFERENCE_TYPE_PROPERTY, PATH_REFERENCE );
    return inlinePolicyDefn;
    return null;
    * Please complete the missing tags for getCDATAAttributeNames
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static Vector getCDATAAttributeNames( LibraryObjectInterface loi )
    throws IfsException
    return getCDATAAttributeNames( loi.getSessionInterface(), loi );
    * Please complete the missing tags for getCDATAAttributeNames
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static Vector getCDATAAttributeNames( LibrarySessionInterface ifs, LibraryObjectInterface loi )
    throws IfsException
    if( DEBUG )
    Alert.log( "RendererUtilities.getDATAAttributeNames: Processing Class " + getClassObjectName( loi ) );
    AttributeValue av = null;
    if( ifs instanceof LibrarySession )
    LibraryObject lo = ( LibraryObject ) loi;
    ClassObject co = lo.getClassObject();
    PropertyBundle renderingRules = getRenderingRules( ifs, co );
    if( null != renderingRules )
    av = renderingRules.getPropertyValue( CDATA_LIST );
    else
    S_LibraryObject lo = ( S_LibraryObject ) loi;
    S_ClassObject co = lo.getClassObject();
    S_PropertyBundle renderingRules = getRenderingRules( ifs, co );
    if( null != renderingRules )
    av = renderingRules.getPropertyValue( CDATA_LIST );
    if( ( av != null ) && ( ! av.isNullValue() ) )
    Vector v = new Vector();
    String [] s = av.getStringArray( ifs );
    for( int i = 0; i < s.length; i++ )
    v.addElement( s [ i ] );
    return v;
    return new Vector();
    * Please complete the missing tags for getRootFolderPath
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static String getRootFolderPath( LibraryObjectInterface loi )
    throws IfsException
    if( loi instanceof LibraryObject )
    PublicObject po = ( PublicObject ) loi;
    Folder target = getRootFolder( po.getSession() );
    return getFolderPath( target, po );
    else
    S_PublicObject po = ( S_PublicObject ) loi;
    S_Folder target = getRootFolder( po.getSession() );
    return getFolderPath( t arget, po );
    * Please complete the missing tags for getRootFolder
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static S_Folder getRootFolder( S_LibrarySession sess )
    throws IfsException
    S_Folder folder = null;
    Collection c = sess.getValueDefaultCollection();
    S_ValueDefault vd = ( S_ValueDefault ) c.getItems( "RootFolder" );
    AttributeValue av = vd.getPropertyValue();
    return( S_Folder ) av.getPublicObject( sess );
    * Please complete the missing tags for getRootFolder
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static Folder getRootFolder( LibrarySession sess )
    throws IfsException
    return sess.getRootFolder();
    * Please complete the missing tags for dumpValueDefaultPB
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void dumpValueDefaultPB( LibrarySession ifs, ValueDefault vd )
    throws IfsException
    PropertyBundle pb = vd.getValueDefaultPropertyBundle();
    AttributeValue av = pb.getPropertyValue( ValueDefault.CLASS_NAME );
    pb = ( PropertyBundle ) av.getPublicObject( ifs );
    Property [] props = pb.getProperties();
    if( props != null )
    for( int i = 0; i < props.length; i++ )
    Alert.log( "RendererUtilities.dumpValueDefaultPB(): Property " + i + " = " + props [ i ] .getName() + " = " + props [ i ] .getValue() );
    else
    Alert.log( "RendererUtilities.dumpValueDefaultPB(): No Properties Defined" );
    * Please complete the missing tags for getRenderingRules
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static S_PropertyBundle getRenderingRules( LibrarySessionInterface ifs, S_ClassObject co )
    throws IfsException
    S_PropertyBundle renderingRules = null;
    Collection c = ifs.getValueDefaultCollection();
    try
    S_ValueDefault rendererConfiguration = ( S_ValueDefault ) c.getItems( CONFIGURATION );
    AttributeValue av = rendererConfiguration.getAttribute( ValueDefault.VALUEDEFAULTPROPERTYBUNDLE_ATTRIBUTE );
    S_PropertyBundle pb = ( S_PropertyBundle ) av.getPublicObject( ifs );
    av = pb.getPropertyValue( ValueDefault.CLASS_NAME );
    pb = ( S_PropertyBundle ) av.getPublicObject( ifs );
    for( S_ClassObject classObject = co;
    classObject != null;
    classObject = classObject.getSuperclass() )
    av = pb.getPropertyValue( classObject.getName() );
    if( ( av != null ) && ( ! av.isNullValue() ) )
    break;
    if( av != null )
    renderingRules = ( S_PropertyBundle ) av.getPublicObject( ifs );
    return renderingRules;
    catch( IfsException e )
    if( e.containsErrorCode( 12200 ) )
    return null;
    else
    throw e;
    * Please complete the missing tags for getRenderingRules
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static PropertyBundle getRenderingRules( LibrarySessionInterface ifs, ClassObject co )
    throws IfsException
    PropertyBundle renderingRules = null;
    Collection c = ifs.getValueDefaultCollection();
    try
    ValueDefault rendererConfiguration = ( ValueDefault ) c.getItems( CONFIGURATION );
    AttributeValue av = rendererConfiguration.getAttribute( ValueDefault.VALUEDEFAULTPROPERTYBUNDLE_ATTRIBUTE );
    PropertyBundle pb = ( PropertyBundle ) av.getPublicObject( ifs );
    av = pb.getPropertyValue( ValueDefault.CLASS_NAME );
    pb = ( PropertyBundle ) av.getPublicObject( ifs );
    for( ClassObject classObject = co;
    classObject != null;
    classObject = classObject.getSuperclass() )
    av = pb.getPropertyValue( classObject.getName() );
    if( ( av != null ) && ( ! av.isNullValue() ) )
    break;
    if( av != null )
    renderingRules = ( PropertyBundle ) av.getPublicObject( ifs );
    return renderingRules;
    catch( IfsException e )
    if( e.containsErrorCode( 12200 ) )
    return null;
    else
    throw e;
    * Please complete the missing tags for getAttributeNames
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String [] getAttributeNames( LibraryObjectInterface loi )
    throws IfsException
    if( loi instanceof LibraryObject )
    LibraryObject lo = ( LibraryObject ) loi;
    return getAttributeNames( loi.getSessionInterface(), lo.getClassObject() );
    else
    S_LibraryObject lo = ( S_LibraryObject ) loi;
    return getAttributeNames( loi.getSessionInterface(), lo.getClassObject() );
    * Please complete the missing tags for getAttributeNames
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String [] getAttributeNames( LibrarySessionInterface ifs, S_ClassObject co )
    throws IfsException
    // Find the Renderinbg Rules for this class or one of it's super Class
    S_PropertyBundle renderingRules = getRenderingRules( ifs, co );
    if( null != renderingRules )
    // RenderingRules defined for this Class Object
    // Check if an Exclude Class is defined....
    String [] attributeNames;
    AttributeValue av = renderingRules.getPropertyValue( EXCLUDE_CLASS );
    if( av != null )
    // Exclude Class is defined. Render attributes defined by Subclasses of Exclude Class
    S_Attribute [] attributes = new S_Attribute [ 0 ];
    if( av.getDataType() == Attribute.ATTRIBUTEDATATYPE_STRING )
    // Special Case.. Allows user to Define LibraryObject as the Exclude Class. If the Exclude
    // Class is a String simple Render all Attributes of the target Object.
    if( DEBUG )
    Alert.log( "RendererUtilities.getAttributeNames: Exclude Class defined as LibraryObject." );
    attributes = co.getEffectiveClassAttributes();
    else
    S_ClassObject excludeClass = ( S_ClassObject ) av.getSchemaObject( ifs );
    if( DEBUG )
    Alert.log( "RendererUtilities.getAttributeNames: Exclude Class defined as " + excludeClass.getName() );
    attributes = co.getExtendedClassAttributes( excludeClass );
    attributeNames = getAttributeNames( attributes );
    else
    // No Exclude Class defined. Render extended Attributes defined by this Class Object.
    attributeNames = getExtendedAttributes( co );
    String [] exceptionList = new String [ 0 ];
    av = renderingRules.getPropertyValue( INCLUDE_ATTRIBUTES );
    if( av != null )
    // Add the Exception List to the List of Attributes to be Rendered
    exceptionList = av.getStringArray( ifs );
    attributeNames = mergeLists( attributeNames, exceptionList );
    return attributeNames;
    else
    // No Renderer Configuration defined for this Class Object: Render Extended Attributes defined by this ClassObject
    if( DEBUG )
    Alert.log( "RendererUtilities.getAttributeNames: No RendererConfiguration for this class: Rendering Extended Attributes" );
    return getExtendedAttributes( co );
    * Please complete the missing tags for getExtendedAttributes
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String [] getExtendedAttributes( S_ClassObject co )
    throws IfsException
    S_Attribute [] attributes = co.getExtendedClassAttributes();
    if( attributes.length > 0 )
    return getAttributeNames( attributes );
    else
    // This Class Object does not define extended attributes.
    // Render extended Attributes according to rules of Super Class.
    return getAttributeNames( co.getSuperclass() );
    * Please complete the missing tags for getExtendedAttributes
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String [] getExtendedAttributes( ClassObject co )
    throws IfsException
    Attribute [] attributes = co.getExtendedClassAttributes();
    if( attributes.length > 0 )
    return getAttributeNames( attributes );
    else
    // This Class Object does not define extended attributes.
    // Render extended Attributes according to rules of Super Class.
    return getAttributeNames( co.getSuperclass() );
    * Please complete the missing tags for getAttributeNames
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String [] getAttributeNames( S_Attribute [] attributes )
    throws IfsException
    String [] attributeNames = new String [ attributes.length ];
    for( int i = 0; i < attributes.length; i++ )
    Object nextAttribute = attributes [ i ];
    S_Attribute attribute = ( S_Attribute ) nextAttribute;
    attributeNames [ i ] = attribute.getName();
    return attributeNames;
    * Please complete the missing tags for getAttributeNames
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String [] getAttributeNames( Attribute [] attributes )
    throws IfsException
    String [] attributeNames = new String [ attributes.length ];
    for( int i = 0; i < attributes.length; i++ )
    Object nextAttribute = attributes [ i ];
    Attribute attribute = ( Attribute ) nextAttribute;
    attributeNames [ i ] = attribute.getName();
    return attributeNames;
    * Please complete the missing tags for getFolderPath
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String getFolderPath( S_Folder target, S_PublicObject po )
    throws IfsException
    // Ensure root Folder is initialized
    String path = null;
    if( po.equals( target ) )
    if( target.equals( getRootFolder( po.getSession() ) ) )
    // Path starts with '/....'
    path = "";
    else
    // Path starts with 'folderName...'
    path = po.getName();
    else
    S_PublicObject [] parents = po.getLeftwardRelationshipObjects( po.getSession().getDefaultFolderRelationshipClassname(), null );
    if( parents != null )
    for( int i = 0; i < parents.length; i++ )
    path = getFolderPath( target, parents [ i ] );
    if( path != null )
    // We found a path to the target Folder for this parent
    // Path = path/name.....
    path = path + po.getSession().getFolderPathDelimiter() + po.getName();
    break;
    // If we get here path and is still null and there is no root from the current object to the target Object.
    return path;
    * Please complete the missing tags for getFolderPath
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String getFolderPath( Folder target, PublicObject po )
    throws IfsException
    // Ensure root Folder is initialized
    String path = null;
    if( po.equals( target ) )
    if( target.equals( getRootFolder( po.getSession() ) ) )
    // Path starts with '/....'
    path = "";
    else
    // Path starts with 'folderName...'
    path = po.getName();
    else
    PublicObject [] parents = po.getFolderReferences();
    if( parents != null )
    for( int i = 0; i < parents.length; i++ )
    path = getFolderPath( target, parents [ i ] );
    if( path != null )
    // We found a path to the target Folder for this parent
    // Path = path/name.....
    path = path + po.getSession().getFolderPathDelimiter() + po.getName();
    break;
    // If we get here path and is still null and there is no root from the current object to the target Object.
    return path;
    * Please complete the missing tags for mergeLists
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String [] mergeLists( String [] attributeList, String [] exceptionList )
    throws IfsException
    if( exceptionList.length > 0 )
    String [] newAttributeList = new String [ attributeList.length + exceptionList.length ];
    for( int i = 0; i < exceptionList.length; i++ )
    if( DEBUG )
    Alert.log( "RenderUtilities.addExceptionList(): Adding " + exceptionList [ i ] );
    newAttributeList [ i ] = exceptionList [ i ];
    for( int i = 0; i < attributeList.length; i++ )
    newAttributeList [ exceptionList.length + i ] = attributeList [ i ];
    return newAttributeList;
    else
    return attributeList;
    null

  • Need a fix for Muse upload problems to GoDaddy????  I found one!

    GoDaddy now has a new cpanel named "Plesk".  In that panel you will find File Manager.  (I use the Windows version).  In the left panel of File Manager, you will see the root directory and all of its subfolders.  When you click on any of these folders, you will see their contents in the right panel.  You will also see a folder labelled "httpdocs".  This is the default folder that is set up in GoDaddy to be your "home" folder.  So, to fix your upload problems, do these steps:
    1.  Click on the httpdocs folder to see it open in the right panel.  In the toolbar above the right panel, you will see a green plus sign with the word "New".  Click on this drop-down menu.
    2.  Choose "directory"
    3.  Type in the name of one of the folders that your site will need, e.g. images, css, assets, scripts, etc.  This basically creates a subfolder within the httpdocs folder, right?  (There is a way to see how your Muse site sets up these folders prior to publish or upload.  You do this by choosing "Export as HTML" in the File menu of Muse, creating a folder on your desktop (or wherever) for the HTML export, then inspecting its contents after your save it.)
    4.  Continue to create all the subfolders within httpdocs that you will need.  Unfortunately, you have to do this one folder at a time.
    5.  After you have them set up, begin the process of uploading your site, like this:
    6.  In the File menu in Muse, you'll of course see "Upload to FTP Host ...".  Click on it.
    7.  A dialog box will open.  In the top text field, type in your website name ... you must use www. with your entry
    8.  In the "FTP Host" field, type in your domain name again like this ... "ftp.yourdomain.com" ... NO FORWARD SLASHES!!! (even if you find instructions to the contrary, like in Filezilla)  (Also, your domain might be a .org or .net, instead of a .com)
    9.  In the "Host directory" field, YOU MUST ENTER "httpdocs"!!!!  Despite what you learn, DO NOT LEAVE THIS FIELD BLANK!!!
    10.  Then enter your GoDaddy username and password.  (If you set up a different username for your GoDaddy account and your Plesk account, like I did, then use your Plesk username and password.)
    11.  Click on "Upload:  All Files"
    The next few steps are tedious, but necessary to keep your site organized on GoDaddy and to keep from confusing things.  You can probably get away with it, but, if your site doesn't load properly in a browser after doing the above steps, you'll need to click on each folder in the root directory that you copied as a subfolder in the "httpdocs" folder and delete the files.  For example, in the left panel of File Manager, you'll see the root directory.  Click on the "images" folder.  If there are any images that you need for your site in that folder, delete them.  Remember ... you've already copied them over to the images subfolder in httpdocs during your last upload described in the instructions above.  If you don't trust that you can delete them, click on the "httpdocs" folder, then click on the "images" folder and check the files.  Same files, right?  So, go ahead and delete the site files that you find in the appropriate folders in the root directory, making sure that you don't delete the ones that are NOT duplicated within the "httpdocs" folder.  Also remember that your .html pages will not require a subfolder to be set up in the "httpsdocs" folder.  They can just sit there, looking pretty.  But you will have to delete them from the root directory to keep things tidy.  Just click on the folder icon next to "root directory", and you'll see those html pages in the right panel.  Again, delete them. 
    REMEMBER:  To keep your Muse uploads to your GoDaddy site error free, you must ALWAYS make sure that "httpdocs" appears in the "Host directory" field in the "Upload to FTP Host ..." dialog box in Muse.  And all files and folders that your site needs MUST go in the "httpdocs" folder in the root directory of your site in GoDaddy's File Manager (now found in your Plesk Panel).
    I hope this wasn't too confusing.  If so, call GoDaddy.  I called them with this fix and they are using it in their phone support.

    Thank you! Thank you! Thank you! I was going out of my mind. And GoDaddy was no help (although they're usually really good.) I put all the folders in "httpdocs" and the website worked perfectly!

  • A different uploading problem

    I have read through the discussions and see that a lot of people are having an uploading problem. I am too, but my problem is a little different. When I upload my photos, everything seems to be fine, all the pages turn from blue to red, and it appears to be done. But, if I quit iWeb, it says it hasn't finished uploading. When I go to the site on the web, everything is there. So, it seems to not be finalizing the last little part where it marks the files as uploaded.
    I am using iWeb 1.1.1.
    I have tried deleting the files from my iDisk and uploading again.
    I have repaired permissions.
    I have deleted the file com.apple.iWeb.plist
    It's not that I'm trying to quit too soon, I have left it for hours, even overnight, and it doesn't complete.
    There's a small circle to the right of the word site that fills in to show progress as it's finishing, and that gets to the point where there's only a small sliver of white.
    Any ideas? Thanks for the help!
    Kirsten
    MacBook   Mac OS X (10.4.7)  

    Have you tried "Publish ALL to .Mac"?

  • How to manage HTTP uploads usings Linksys RV042

    Hello
    I have recently bought a RV042, and so far it is working well.
    I am using it as a load balancer for 2 WANs having different speeds.
    I am looking to find out how to let the HTTP upload handled by one of these WANs, while the HTTP download is handeled by the other. I'm not sure if this will technically work anyway; I have doubts. If it doesn't can I specify which WAN to be used for specific websites? (ex. Gmail, Media Fire etc...) ??
    Thank you

    Protocol Binding allows you to bind certain traffic to certain WAN port based on Service and IP Address.

  • Is Safari the problem?  upload problems after Leopard install...

    I installed maximum ram and leopard 10.5 on my old emac and it runs great. I had problems uploading photos to ebay, and attachments to emails, so I installed ilife hoping the upgrade would fix the problem. Nope, when I attempt to upload, the icon just spins and spins, on and on. Could this be a Safari problem? Very frustrated, totally stumped.

    I'm not sure how to link to the iPhoto post thread that help me solve my upload problem. But it is solved. I had to resize the jpeg pic files to 640x320 because my files were way to big. Thanks Old Toad!

  • Apache Bridge HTTP POST problems on large file upload

    I have a problem uploading files larger than quarter a mega, the jsp
    page does a POSTto a servlet which reads the input stream and writes to
    a file.
    Configuration: Apache webserver 1.3.12 connected to the Weblogic 5.1
    application server via the bridge(mod_wl_ssl.so) from WebLogic Service
    pack 4.
    The upload goes on for about 30 secs and throws the following error.
    "Failure of WebLogic APACHE bridge:
    IO error writing POST data to 100.12.1.2:7001; sys err#: [32] sys err
    msg [Broken pipe]
    Build date/time: Jul 10 2000 12:29:18 "
    The same upload(in fact I uploaded a 8 MEG file) using the
    Netscape(NSAPI) WebLogicconnector.
    Any answers would be deeply appreciated.
    [email protected]

    It appears to be a bug.
    I suggest that you file a bug report with our support organization. Be sure
    to include a complete test case. They will also need information from
    you -- please review our external support procedures:
    http://www.beasys.com/support/index.html
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    "George Abraham" <[email protected]> wrote in message
    news:[email protected]..
    I have a problem uploading files larger than quarter a mega, the jsp
    page does a POSTto a servlet which reads the input stream and writes to
    a file.
    Configuration: Apache webserver 1.3.12 connected to the Weblogic 5.1
    application server via the bridge(mod_wl_ssl.so) from WebLogic Service
    pack 4.
    The upload goes on for about 30 secs and throws the following error.
    "Failure of WebLogic APACHE bridge:
    IO error writing POST data to 100.12.1.2:7001; sys err#: [32] sys err
    msg [Broken pipe]
    Build date/time: Jul 10 2000 12:29:18 "
    The same upload(in fact I uploaded a 8 MEG file) using the
    Netscape(NSAPI) WebLogicconnector.
    Any answers would be deeply appreciated.
    [email protected]

  • Upload and http auth problem

    Hello.
    I wrote flex application with http basic authorization. After
    I successfuly loginin i try to upload file and independently of
    used browser I recieve authorization window from IE and I have to
    enter login/passwd second time. After it everything work fine and I
    can upload more files without authorization window. How can I make
    away this window? Is there any securinty flash settings?
    bye...

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    Flex 3 - Working with file upload and download:
    The SWF tried to upload a file to a server that requires
    authentication (such as a user name and password). During upload,
    Flash Player does not provide a
    Link:
    http://livedocs.adobe.com/flex/3/html/17_Networking_and_communications_7.html
    9 Flex File Upload Examples Visited:
    Flash 8 File Upload Download. As we know the Flex Upload is
    actually use the Flash 8 FileReference object to do the work. The
    guy who is writing the book
    Link:
    http://www.flex888.com/296/9-flex-file-upload-examples-visited.html
    Flex 3 - Example: Uploading and downloading files:
    The main application file in Flash (FLA) or Flex (MXML). ...
    A class that includes methods for uploading files to a server.
    Link:
    http://livedocs.adobe.com/flex/3/html/17_Networking_and_communications_9.html
    File Upload in Flex/Flash in Internet Explorer:
    Because Macromedia Flash doesn't include the capability to
    upload files, a Macromedia Flex developer will need to use multiple
    technologies to add uploading
    Link:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19382
    Adobe - Developer Center : Multiple file upload with Flex
    and:
    Sep 11, 2006 ... Through the Multi-File Upload application,
    you will learn how to do the ... capabilities of Flex 2, Flash
    Player 9, and ColdFusion MX 7 file
    Link:
    http://www.adobe.com/devnet/coldfusion/articles/multifile_upload.html
    Derrick Grigg's Blog, Flex and Flash file uploading with
    return data:
    I see one for Flex and other for Coldfusion, but none for
    Flash. Maybe the title should be Flex and CF file uploading with
    return data?
    Link:
    http://www.dgrigg.com/post.cfm/08/02/2007/Flex-and-Flash-file-uploading-with-return-data
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

  • Help with ftp upload problem

    Hi I am using a ftp class (known as FTPConnection) that i found on this site: http://www.nsftools.com/tips/JavaFtp.htm , and they only have an example of how to download a File through FTP and not upload one. I am in the proccess of making an FTP upload applet, and need some help on getting upload to work. I also need it to work on both a Pc and mac, so that may be attributing to the problem becuase i am currently on a mac which uses file:// instead of C:\\. Ill post the ftp class, and a snippet of my code that tries to upload a selected file.
    FTPConnection
    /* <!-- in case someone opens this in a browser... --> <pre> */
    * File:   FTPConnection.java
    * Author: Bret Taylor <[email protected]>
    * URL: http://www.stanford.edu/~bstaylor/cs/ftpconnection/FTPConnection.java.shtml
    * see also <a href="http://www.nsftools.com/tips/JavaFtp.htm">http://www.nsftools.com/tips/JavaFtp.htm</a>
    * $Id$
    * Parts of this code were adopted from a variety of other FTP classes the
    * author has encountered that he was not completely satisfied with.  If you
    * think more thanks are due to any particular author than is given, please
    * let him know.  With that caveat, this class can be freely distributed and
    * modified as long as Bret Taylor is given credit in the source code comments.
    * Modified by Julian Robichaux -- http://www.nsftools.com
    * Added constructors, logout(), listFiles(), listSubdirectories(), getAndParseDirList(),
    * processFileListCommand(), and overloaded getFullServerReply().
    * Also added StringBuffer parameter options to transferData() and executeDataCommand()
    * and did a few other little things.
    import java.io.*;
    import java.net.*;
    import java.util.*;
    * <p>A wrapper for the network and command protocols needed for the most common
    * FTP commands.  Standard usage looks something like this:</p>
    * <pre> FTPConnection connection = new FTPConnection();
    * try {
    *     if (connection.connect(host)) {
    *         if (connection.login(username, password)) {
    *             connection.downloadFile(serverFileName);
    *             connection.uploadFile(localFileName);
    *         connection.disconnect();
    * } catch (UnknownHostException e) {
    *     // handle unknown host
    * } catch (IOException e) {
    *     // handle I/O exception
    * }</pre>
    * <p>Most FTP commands are wrapped by easy-to-use methods, but in case clients
    * need more flexibility, you can execute commands directly using the methods
    * <a href="#executeCommand(java.lang.String)">executeCommand</a> and
    * <a href="#executeDataCommand(java.lang.String,
    * java.io.OutputStream)">executeDataCommand</a>,
    * the latter of which is used for commands that require an open data port.</p>
    * @author Bret Taylor
    * @author Julian Robichaux
    * @version 1.01
    public class FTPConnection extends Object {
         * If this flag is on, we print out debugging information to stdout during
         * execution.  Useful for debugging the FTP class and seeing the server's
         * responses directly.
        private static boolean PRINT_DEBUG_INFO = false;
         * The socket through which we are connected to the FTP server.
        private Socket connectionSocket = null;
         private String username;
         private String password;
         private String host;
         * The socket output stream.
        private PrintStream outputStream = null;
         * The socket input stream.
        private BufferedReader inputStream = null;
         * The offset at which we resume a file transfer.
        private long restartPoint = 0L;
         * Added by Julian: If this flag is on, we're currently logged in to something.
        private boolean loggedIn = false;
         * Added by Julian: This is the line terminator to use for multi-line responses.
        public String lineTerm = "\n";
         * Added by Julian: This is the size of the data blocks we use for transferring
         * files.
        private static int BLOCK_SIZE = 4096;
         * Added by Julian: After you create an FTPConnection object, you will call the
         * connect() and login() methods to access your server. Please don't forget to
         * logout() and disconnect() when you're done (it's only polite...).
        public FTPConnection ()
             // default constructor (obviously) -- this is just good to have...
         * Added by Julian: Allows you to specify if you want to send debug output to
         * the console (true if you do, false if you don't).
        public FTPConnection (boolean debugOut)
             PRINT_DEBUG_INFO = debugOut;
         public FTPConnection (String user, String pw, String host_)
             username=user;
              password=pw;
              host=host_;
              PRINT_DEBUG_INFO = false;
         * Prints debugging information to stdout if the private flag
         * <code>PRINT_DEBUG_INFO</code> is turned on.
        private void debugPrint(String message) {
            if (PRINT_DEBUG_INFO) System.err.println(message);
         * Connects to the given FTP host on port f, the default FTP port.
        public boolean connect(String host)
            throws UnknownHostException, IOException
            return connect(host, 21);
         * Connects to the given FTP host on the given port.
        public boolean connect(String host, int port)
            throws UnknownHostException, IOException
            connectionSocket = new Socket(host, port);
              connectionSocket.setSoTimeout(10000);
            outputStream = new PrintStream(connectionSocket.getOutputStream());
            inputStream = new BufferedReader(new
                           InputStreamReader(connectionSocket.getInputStream()));
            if (!isPositiveCompleteResponse(getServerReply())){
                disconnect();
                return false;
            return true;
         * Disconnects from the host to which we are currently connected.
         static boolean URLexists(String URLName)
              try
                   HttpURLConnection.setFollowRedirects(false);
                   // note : you may also need
                   // HttpURLConnection.setInstanceFollowRedirects(false)
                   HttpURLConnection con =
                   (HttpURLConnection) new URL(URLName).openConnection();
                   con.setRequestMethod("HEAD");
                   return (con.getResponseCode() == HttpURLConnection.HTTP_OK);
              catch (Exception e)
                   e.printStackTrace();
                   return false;
         public String getSimpleFileName(File f)
              String path=f.getPath();
              String fileName=path.replace("\\", "/");
              int slashPos = fileName.lastIndexOf("/");
              fileName=fileName.substring(slashPos+1);
              return fileName;
         public String verifyFileName(String name)
              int count=0;
              //String url="http://chris-malcolm.com/images/"+URLEncoder.encode(name).replace("+", "%20");
              while (URLexists("http://chris-malcolm.com/images/"+URLEncoder.encode(name).replace("+", "%20"))==true)
              count++;
              name=FileExt(name)[0]+"-"+count+"."+FileExt(name)[1];
              return name;
         public String[] FileExt(String fileName)
            int dotPos = fileName.lastIndexOf(".");
              fileName=fileName.replace("\\", "/");
              int slashPos = fileName.lastIndexOf("/");
              String extension, name;
              if (slashPos==fileName.length()-1)
                   fileName=fileName.substring(0, fileName.length()-1);
                   slashPos=fileName.lastIndexOf("/");
                   extension="/";
                   name=fileName.substring(slashPos+1);
              else if(dotPos==-1)
                   name=fileName.substring(slashPos+1);
                   extension="";
              else
                   extension = fileName.substring(dotPos+1);
                   name=fileName.substring(slashPos+1, dotPos);
                   String[] output={name, extension};
                   return output;
              String[] output={name, extension};
              return output;
        public void disconnect()
            if (outputStream != null) {
                try {
                      if (loggedIn) { logout(); };
                    outputStream.close();
                    inputStream.close();
                    connectionSocket.close();
                } catch (IOException e) {}
                outputStream = null;
                inputStream = null;
                connectionSocket = null;
         * Wrapper for the commands <code>user [username]</code> and <code>pass
         * [password]</code>.
        public boolean login(String username, String password)
            throws IOException
            int response = executeCommand("user " + username);
            if (!isPositiveIntermediateResponse(response)) return false;
            response = executeCommand("pass " + password);
            loggedIn = isPositiveCompleteResponse(response);
            return loggedIn;
         * Added by Julian: Logout before you disconnect (this is good form).
        public boolean logout()
            throws IOException
            int response = executeCommand("quit");
            loggedIn = !isPositiveCompleteResponse(response);
            return !loggedIn;
         * Wrapper for the command <code>cwd [directory]</code>.
        public boolean changeDirectory(String directory)
            throws IOException
            int response = executeCommand("cwd " + directory);
            return isPositiveCompleteResponse(response);
         * Wrapper for the commands <code>rnfr [oldName]</code> and <code>rnto
         * [newName]</code>.
        public boolean renameFile(String oldName, String newName)
            throws IOException
            int response = executeCommand("rnfr " + oldName);
            if (!isPositiveIntermediateResponse(response)) return false;
            response = executeCommand("rnto " + newName);
            return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>mkd [directory]</code>.
        public boolean makeDirectory(String directory)
            throws IOException
            int response = executeCommand("mkd " + directory);
            return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>rmd [directory]</code>.
        public boolean removeDirectory(String directory)
            throws IOException
            int response = executeCommand("rmd " + directory);
            return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>cdup</code>.
        public boolean parentDirectory()
            throws IOException
            int response = executeCommand("cdup");
            return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>dele [fileName]</code>.
        public boolean deleteFile(String fileName)
            throws IOException
            int response = executeCommand("dele " + fileName);
            return isPositiveCompleteResponse(response);
         * Wrapper for the command <code>pwd</code>.
        public String getCurrentDirectory()
            throws IOException
            String response = getExecutionResponse("pwd");
            StringTokenizer strtok = new StringTokenizer(response);
            // Get rid of the first token, which is the return code
            if (strtok.countTokens() < 2) return null;
            strtok.nextToken();
            String directoryName = strtok.nextToken();
            // Most servers surround the directory name with quotation marks
            int strlen = directoryName.length();
            if (strlen == 0) return null;
            if (directoryName.charAt(0) == '\"') {
                directoryName = directoryName.substring(1);
                strlen--;
            if (directoryName.charAt(strlen - 1) == '\"')
                return directoryName.substring(0, strlen - 1);
            return directoryName;
         * Wrapper for the command <code>syst</code>.
        public String getSystemType()
            throws IOException
            return excludeCode(getExecutionResponse("syst"));
         * Wrapper for the command <code>mdtm [fileName]</code>.  If the file does
         * not exist, we return -1;
        public long getModificationTime(String fileName)
            throws IOException
            String response = excludeCode(getExecutionResponse("mdtm " + fileName));
            try {
                return Long.parseLong(response);
            } catch (Exception e) {
                return -1L;
         * Wrapper for the command <code>size [fileName]</code>.  If the file does
         * not exist, we return -1;
        public long getFileSize(String fileName)
            throws IOException
            String response = excludeCode(getExecutionResponse("size " + fileName));
            try {
                return Long.parseLong(response);
            } catch (Exception e) {
                return -1L;
         * Wrapper for the command <code>retr [fileName]</code>.
        public boolean downloadFile(String fileName)
            throws IOException
            return readDataToFile("retr " + fileName, fileName);
         * Wrapper for the command <code>retr [serverPath]</code>. The local file
         * path to which we will write is given by <code>localPath</code>.
        public boolean downloadFile(String serverPath, String localPath)
            throws IOException
            return readDataToFile("retr " + serverPath, localPath);
         * Wrapper for the command <code>stor [fileName]</code>.
        public boolean uploadFile(String fileName)
            throws IOException
            return writeDataFromFile("stor " + fileName, fileName);
         * Wrapper for the command <code>stor [localPath]</code>. The server file
         * path to which we will write is given by <code>serverPath</code>.
        public boolean uploadFile(String serverPath, String localPath)
            throws IOException
            return writeDataFromFile("stor " + serverPath, localPath);
         * Set the restart point for the next download or upload operation.  This
         * lets clients resume interrupted uploads or downloads.
        public void setRestartPoint(int point)
            restartPoint = point;
            debugPrint("Restart noted");
         * Gets server reply code from the control port after an ftp command has
         * been executed.  It knows the last line of the response because it begins
         * with a 3 digit number and a space, (a dash instead of a space would be a
         * continuation).
        private int getServerReply()
            throws IOException
            return Integer.parseInt(getFullServerReply().substring(0, 3));
         * Gets server reply string from the control port after an ftp command has
         * been executed.  This consists only of the last line of the response,
         * and only the part after the response code.
        private String getFullServerReply()
            throws IOException
            String reply;
            do {
                reply = inputStream.readLine();
                debugPrint(reply);
            } while(!(Character.isDigit(reply.charAt(0)) &&
                      Character.isDigit(reply.charAt(1)) &&
                      Character.isDigit(reply.charAt(2)) &&
                      reply.charAt(3) == ' '));
            return reply;
         * Added by Julian: Returns the last line of the server reply, but also
         * returns the full multi-line reply in a StringBuffer parameter.
        private String getFullServerReply(StringBuffer fullReply)
             throws IOException
            String reply;
            fullReply.setLength(0);
            do {
                reply = inputStream.readLine();
                debugPrint(reply);
                fullReply.append(reply + lineTerm);
            } while(!(Character.isDigit(reply.charAt(0)) &&
                      Character.isDigit(reply.charAt(1)) &&
                      Character.isDigit(reply.charAt(2)) &&
                      reply.charAt(3) == ' '));
              // remove any trailing line terminators from the fullReply
              if (fullReply.length() > 0) 
                   fullReply.setLength(fullReply.length() - lineTerm.length());
            return reply;
         * Added by Julian: Gets a list of files in the current directory.
         public String listFiles()
              throws IOException
              return listFiles("");
         * Added by Julian: Gets a list of files in either the current
         * directory, or one specified as a parameter. The 'params' parameter
         * can be either a directory name, a file mask, or both (such as
         * '/DirName/*.txt').
         public String listFiles(String params)
              throws IOException
              StringBuffer files = new StringBuffer();
              StringBuffer dirs = new StringBuffer();
              if (!getAndParseDirList(params, files, dirs))
                   debugPrint("Error getting file list");
              return files.toString();
         * Added by Julian: Gets a list of subdirectories in the current directory.
         public String listSubdirectories()
              throws IOException
              return listSubdirectories("");
         * Added by Julian: Gets a list of subdirectories in either the current
         * directory, or one specified as a parameter. The 'params' parameter
         * can be either a directory name, a name mask, or both (such as
         * '/DirName/Sub*').
         public String listSubdirectories(String params)
              throws IOException
              StringBuffer files = new StringBuffer();
              StringBuffer dirs = new StringBuffer();
              if (!getAndParseDirList(params, files, dirs))
                   debugPrint("Error getting dir list");
              return dirs.toString();
         * Added by Julian: Sends and gets the results of a file list command,
         * like LIST or NLST.
        private String processFileListCommand(String command)
            throws IOException
            StringBuffer reply = new StringBuffer();
            String replyString;
            // file listings require you to issue a PORT command,
            // like a file transfer
              boolean success = executeDataCommand(command, reply);
              if (!success)
                   return "";
            replyString = reply.toString();
            // strip the trailing line terminator from the reply
            if (reply.length() > 0)
                 return replyString.substring(0, reply.length() - 1);
            }  else  {
                 return replyString;
          * Added by Julian: Gets a directory list from the server and parses
          * the elements into a list of files and a list of subdirectories.
         private boolean getAndParseDirList(String params, StringBuffer files, StringBuffer dirs)
              throws IOException
              // reset the return variables (we're using StringBuffers instead of
              // Strings because you can't change a String value and pass it back
              // to the calling routine -- changing a String creates a new object)
              files.setLength(0);
              dirs.setLength(0);
              // get the NLST and the LIST -- don't worry if the commands
              // don't work, because we'll just end up sending nothing back
              // if that's the case
              String shortList = processFileListCommand("nlst " + params);
              String longList = processFileListCommand("list " + params);
              // tokenize the lists we got, using a newline as a separator
              StringTokenizer sList = new StringTokenizer(shortList, "\n");
              StringTokenizer lList = new StringTokenizer(longList, "\n");
              // other variables we'll need
              String sString;
              String lString;
              // assume that both lists have the same number of elements
              while ((sList.hasMoreTokens()) && (lList.hasMoreTokens())) {
                   sString = sList.nextToken();
                   lString = lList.nextToken();
                   if (lString.length() > 0)
                        if (lString.startsWith("d"))
                             dirs.append(sString.trim() + lineTerm);
                             debugPrint("Dir: " + sString);
                        }  else if (lString.startsWith("-"))  {
                             files.append(sString.trim() + lineTerm);
                             debugPrint("File: " + sString);
                        }  else  {
                             // actually, symbolic links will start with an "l"
                             // (lowercase L), but we're not going to mess with
                             // those
                             debugPrint("Unknown: " + lString);
              // strip off any trailing line terminators and return the values
              if (files.length() > 0)  {  files.setLength(files.length() - lineTerm.length());  }
              if (dirs.length() > 0)  {  dirs.setLength(dirs.length() - lineTerm.length());  }
              return true;
         * Executes the given FTP command on our current connection, returning the
         * three digit response code from the server.  This method only works for
         * commands that do not require an additional data port.
        public int executeCommand(String command)
            throws IOException
            outputStream.println(command);
            return getServerReply();
         * Executes the given FTP command on our current connection, returning the
         * last line of the server's response.  Useful for commands that return
         * one line of information.
        public String getExecutionResponse(String command)
            throws IOException
            outputStream.println(command);
            return getFullServerReply();
         * Executes the given ftpd command on the server and writes the results
         * returned on the data port to the file with the given name, returning true
         * if the server indicates that the operation was successful.
        public boolean readDataToFile(String command, String fileName)
            throws IOException
            // Open the local file
            RandomAccessFile outfile = new RandomAccessFile(fileName, "rw");
            // Do restart if desired
            if (restartPoint != 0) {
                debugPrint("Seeking to " + restartPoint);
                outfile.seek(restartPoint);
            // Convert the RandomAccessFile to an OutputStream
            FileOutputStream fileStream = new FileOutputStream(outfile.getFD());
            boolean success = executeDataCommand(command, fileStream);
            outfile.close();
            return success;
         * Executes the given ftpd command on the server and writes the contents
         * of the given file to the server on an opened data port, returning true
         * if the server indicates that the operation was successful.
        public boolean writeDataFromFile(String command, String fileName)
            throws IOException
            // Open the local file
            RandomAccessFile infile = new RandomAccessFile(fileName, "r");
            // Do restart if desired
            if (restartPoint != 0) {
                debugPrint("Seeking to " + restartPoint);
                infile.seek(restartPoint);
            // Convert the RandomAccessFile to an InputStream
            FileInputStream fileStream = new FileInputStream(infile.getFD());
            boolean success = executeDataCommand(command, fileStream);
            infile.close();
            return success;
         * Executes the given ftpd command on the server and writes the results
         * returned on the data port to the given OutputStream, returning true
         * if the server indicates that the operation was successful.
        public boolean executeDataCommand(String command, OutputStream out)
            throws IOException
            // Open a data socket on this computer
            ServerSocket serverSocket = new ServerSocket(0);
            if (!setupDataPort(command, serverSocket)) return false;
            Socket clientSocket = serverSocket.accept();
            // Transfer the data
            InputStream in = clientSocket.getInputStream();
            transferData(in, out);
            // Clean up the data structures
            in.close();
            clientSocket.close();
            serverSocket.close();
            return isPositiveCompleteResponse(getServerReply());   
         * Executes the given ftpd command on the server and writes the contents
         * of the given InputStream to the server on an opened data port, returning
         * true if the server indicates that the operation was successful.
        public boolean executeDataCommand(String command, InputStream in)
            throws IOException
            // Open a data socket on this computer
            ServerSocket serverSocket = new ServerSocket(0);
            if (!setupDataPort(command, serverSocket)) return false;
            Socket clientSocket = serverSocket.accept();
            // Transfer the data
            OutputStream out = clientSocket.getOutputStream();
            transferData(in, out);
            // Clean up the data structures
            out.close();
            clientSocket.close();
            serverSocket.close();
            return isPositiveCompleteResponse(getServerReply());   
         * Added by Julian: Executes the given ftpd command on the server
         * and writes the results returned on the data port to the given
         * StringBuffer, returning true if the server indicates that the
         * operation was successful.
        public boolean executeDataCommand(String command, StringBuffer sb)
            throws IOException
            // Open a data socket on this computer
            ServerSocket serverSocket = new ServerSocket(0);
            if (!setupDataPort(command, serverSocket)) return false;
            Socket clientSocket = serverSocket.accept();
            // Transfer the data
            InputStream in = clientSocket.getInputStream();
            transferData(in, sb);
            // Clean up the data structures
            in.close();
            clientSocket.close();
            serverSocket.close();
            return isPositiveCompleteResponse(getServerReply());   
         * Transfers the data from the given input stream to the given output
         * stream until we reach the end of the stream.
        private void transferData(InputStream in, OutputStream out)
            throws IOException
            byte b[] = new byte[BLOCK_SIZE];
            int amount;
            // Read the data into the file
            while ((amount = in.read(b)) > 0) {
                out.write(b, 0, amount);
         * Added by Julian: Transfers the data from the given input stream
         * to the given StringBuffer until we reach the end of the stream.
        private void transferData(InputStream in, StringBuffer sb)
            throws IOException
            byte b[] = new byte[BLOCK_SIZE];
            int amount;
            // Read the data into the StringBuffer
            while ((amount = in.read(b)) > 0) {
                sb.append(new String(b, 0, amount));
         * Executes the given ftpd command on the server and writes the results
         * returned on the data port to the given FilterOutputStream, returning true
         * if the server indicates that the operation was successful.
        private boolean setupDataPort(String command, ServerSocket serverSocket)
            throws IOException
            // Send our local data port to the server
            if (!openPort(serverSocket)) return false;
            // Set binary type transfer
            outputStream.println("type i");
            if (!isPositiveCompleteResponse(getServerReply())) {
                debugPrint("Could not set transfer type");
                return false;
            // If we have a restart point, send that information
            if (restartPoint != 0) {
                outputStream.println("rest " + restartPoint);
                restartPoint = 0;
                // TODO: Interpret server response here
                getServerReply();
            // Send the command
            outputStream.println(command);
            return isPositivePreliminaryResponse(getServerReply());
         * Get IP address and port number from serverSocket and send them via the
         * <code>port</code> command to the ftp server, returning true if we get a
         * valid response from the server, returning true if the server indicates
         * that the operation was successful.
        private boolean openPort(ServerSocket serverSocket)
            throws IOException
            int localport = serverSocket.getLocalPort();
            // get local ip address
            InetAddress inetaddress = serverSocket.getInetAddress();
            InetAddress localip;
            try {
                localip = inetaddress.getLocalHost();
            } catch(UnknownHostException e) {
                debugPrint("Can't get local host");
                return false;
            // get ip address in high byte order
            byte[] addrbytes = localip.getAddress();
            // tell server what port we are listening on
            short addrshorts[] = new short[4];
            // problem:  bytes greater than 127 are printed as negative numbers
            for(int i = 0; i <= 3; i++) {
                addrshorts[i] = addrbytes;
    if (addrshorts[i] < 0)
    addrshorts[i] += 256;
    outputStream.println("port " + addrshorts[0] + "," + addrshorts[1] +
    "," + addrshorts[2] + "," + addrshorts[3] + "," +
    ((localport & 0xff00) >> 8) + "," +
    (localport & 0x00ff));
    return isPositiveCompleteResponse(getServerReply());
    * True if the given response code is in the 100-199 range.
    private boolean isPositivePreliminaryResponse(int response)
    return (response >= 100 && response < 200);
    * True if the given response code is in the 300-399 range.
    private boolean isPositiveIntermediateResponse(int response)
    return (response >= 300 && response < 400);
    * True if the given response code is in the 200-299 range.
    private boolean isPositiveCompleteResponse(int response)
    return (response >= 200 && response < 300);
    * True if the given response code is in the 400-499 range.
    private boolean isTransientNegativeResponse(int response)
    return (response >= 400 && response < 500);
    * True if the given response code is in the 500-5

    ok i tried explaining th eproblem in the previous post, but i apologize if my explanation was poor. anyways, i tried to look into it further by doing a printStackTrace() and believe it may be a read error. here is my new updated snippet, and also a link to a screenshot ([click here for screenshot|http://img143.imageshack.us/my.php?image=picture4qr0.png]) of what the error looks like on my end. it seems like a socket is not being read, or maybe it is initialized properly. Again I apologize if my problem is vague, but I do appreciate your input. thanks.
    updated code snippet
    public void uploadFiles()
              statusLabel.setVisible(true);
              errorLabel.setVisible(true);
              uploadButton.setVisible(false);
              footer.setVisible(false);
              holdingPanel.setVisible(false);
              pbar.setVisible(true);
              pbar = new JProgressBar();
              pbar.setMinimum(0);
              float Total=0;
              for (int i=0; i<fileLengths.size(); i++)
                   if(((java.lang.Boolean)model.getValueAt(i,1)).toString().equals("true"))
                        Total+=Float.parseFloat((String)fileLengths.get(i));
              pbar.setMaximum((int)Total);
              String info="";
              try
                   ftp=new FTPConnection(false);
                   ftp.connect("ftp.chris-malcolm.com");
                   if (ftp.login("chrismal", "***"))
                        statusLabel.setText("Status: Connected.");
                        info+="Successfully logged in!\n";
                        info+="System type is: " + ftp.getSystemType()+"\n";
                        info+="Current directory is: " + ftp.getCurrentDirectory()+"\n";
                        if (ftp.changeDirectory("/www/images/"))
                             info+="directory changed to: " + ftp.getCurrentDirectory()+"\n";
                                                 try
                             for (int i=0; i<allFiles.size(); i++)
                                  if(((java.lang.Boolean)model.getValueAt(i,1)).toString().equals("true"))
                                       String f=client.verifyFileName((String)model.getValueAt(i,0));
                                       String f2=""+((File)allFiles.get(i)).getPath();
                                       info+="filename: "+f2+"\n";
                                       if (ftp.uploadFile(f2))
                                            statusLabel.setText("Status: Uploading "+f+" - "+i+" of "+calculateTotalFiles()+" files(s)");
                                            pbar.setValue(Integer.parseInt((String)fileLengths.get(i)));
                                       else
                                            errorLabel.setText("Error occured while uploading"+f2+"\n");
                        catch(Exception de) 
                             StringWriter sw = new StringWriter();
                                  PrintWriter pw = new PrintWriter(sw);
                                  de.printStackTrace(pw);
                                  pw.close();
                                  //errorLabel.setText("<html>ERROR:"+sw.toString().replace("\n", "<br>")+"</html>");
                                  info+="Error: "+de.getMessage()+"\n";
                                  info+="Trace: "+sw+"\n";
                             try { ftp.disconnect(); statusLabel.setText("Status: disconnected.");}  catch(Exception e2)  {};
                        else
                             info+="could not change directory\n";
                   else
                        info+="could not login";
              catch (Exception e)
                   StringWriter sw = new StringWriter();
                                  PrintWriter pw = new PrintWriter(sw);
                                  e.printStackTrace(pw);
                                  pw.close();
                                  info+="Error: "+e.getMessage()+"\n";
                                  info+="Trace: "+sw+"\n";
                   try { ftp.disconnect();  statusLabel.setText("Status: disconnected.");}  catch(Exception e2)  {};
              errorLabel.setText("ERROR:"+info);
              JOptionPane.showMessageDialog(this, info, "test", JOptionPane.PLAIN_MESSAGE);
              try { ftp.disconnect(); statusLabel.setText("Status: disconnected.");}  catch(Exception e2)  {};
         Edited by: cjm771 on Jul 13, 2008 7:23 PM

  • Uploading problems File I/O Error 2038

    Is there any way to get additional information about why this
    error occurs? I am trying to upload a file, but I keep getting a
    File I/O error. When I run the app on my local machine the file
    upload succeeds, the I get a File I/O error. When I try to run the
    same app up on my server I get the same error, but the upload
    script is never even called (i.e. the HTTP request is never sent).
    Any ideas? How can I figure out why I am getting this error?
    Thanks,
    Derek

    Hi
    Can you elaborate on what you did when you changed the
    security settings -> This was fixed by changing the security
    settings.
    I think too that my problem has something to do with security
    settings but I do not know for sure. I only know that my server
    side script is never reached when trying to upload from a MAC
    platform. I'm using a webhotel so I'm pretty limited in changing
    the settings.
    Any help will be greatly appreciated.
    Have a look at my case:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&threadid=1311564

  • File Upload problem: JSF, IBM WPS and Portlet - Please HELP Vey Very Urgent

    I want to upload a file from the front end using JSF and Portlets deployed on IBM WebSphere Portal.
    I have used Apache's commons file upload functionality as the file upload provided in JSF doesnot work with portlets and the action event is not invoked If I keep enctype="multipart/form-data". So I included 3 forms in my Faces JSP file.
    1) h:form = For displyign error message on screen
    2) html:form = Include the enctype="multipart/form-data" and the input type file for uploading. And a submit button
    3) h:form: Here I have a command link which is remotely excuted on click of sumit button in my html form. This is to invoke the action event in the pagecode to get the bean value from the context.
    Now in the my doView method in the portlet, isMultipartContent(httpservletrequest) always returns null as the content type is text/html and not multipart. Onclick of the submit button in the the html form I am calling a javascript function which sets the __LINK_TARGET__ to the command link in the 3rd h:form which will call the page code.
    The problem here is action is invoked only when I return false from the above javascript else it will trigger for the first time and from second time onwards it will not invoke the action event in the pagecode method. Whent the javascript function returns false, the content type is always text/html. However if I return "true" from the javascript the content type is multipart/form-data, but the action is not triggered for the second time. So basically when the javascript functions returns true, for the first click everything works perfectly. When it returns false, the content type is text/html, but the action is invoked in the page code every time.
    Returning always true would solve my problem with the content type, but the action with the command link will not get invoked always as its some type of problem with h:commanLink :(.
    I guess I gave too much info. Heres my code stepby step.
    Can somebody please tell me , how I should also invoke the action in the page code and get the content type as "multipart/form-data" at the same time.
    1:
    ======================= Faces JSP File: BPSMacro.jsp ====================
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta name="GENERATOR" content="IBM Software Development Platform">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
    <%@taglib uri="/WEB-INF/tld/j4j.tld" prefix="j4j"%>
    <%@taglib uri="/WEB-INF/tld/core.tld" prefix="core"%>
    <%@page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1" session="false"%>
    <portlet:defineObjects />
    <link rel="stylesheet" type="text/css"
         href='<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/theme/stylesheet.css") %>'
         title="Style">
    <script type="text/javascript">
    function formSubmit() {
         var formName2 = document.getElementById("proxy_form_main_").title;
         var formName1 = document.getElementById("BPSMacroFormId").title;
         document.getElementById("__LINK_TARGET__").value = document.getElementById("proxy_HD_COMMAND_").title;
         document.getElementById(formName2).submit();
         return false;
    </script>
    <f:view>
         <hx:scriptCollector id="bpsMacroScriptCollector">
              <f:loadBundle var="bps" basename="bordereauprocessingsystem" />
              <table bgcolor="#FFF9C3">
                   <tr>
                        <td><h:form id="BPSMacroFormMain" styleClass="form">
                             <table class="tablemiddle" cellspacing="0" cellpadding="0">
                                  <tr>
                                       <td><h:messages layout="table" styleClass="errormessage"
                                                 id="ValidationErrorMsg" /> </td>
                                  </tr>
                             </table>
                             <j4j:idProxy id="proxy_form_main_0_" />
                        </h:form></td>
                   </tr>
                   <tr>
                        <td>
                        <form id="BPSMacroFormId" enctype="multipart/form-data">
                        <table bgcolor="#FFF9C3">
                             <tr>
                                  <td height="36" width="324">Worksheet <input type="file"
                                       name="upfile" /></td>
                             </tr>
                                  <tr>
                                       <td align="center" width="324"><input TYPE="submit"
                                       onclick="return formSubmit();" value="Upload">
                                  </td>
                             </tr>
                        </table>
                        </form>
                        </td>
                   </tr>
                   <tr>
                        <td>
                        <h:form id="BPSMacroFormMain2" styleClass="form">
                             <table cellspacing="2" cellpadding="2" class="tablemiddle">
                                  <tbody>
                                       <tr>
                                            <td colspan="2" align="center"><h:commandLink
                                                 styleClass="commandLink" id="lnkuserdelete"
                                                 action="#{pc_BPSMacro.doIdUpload1Action}">
                                                 <hx:graphicImageEx
                                                      styleClass="graphicImageEx" id="imgBtnCreateUser"
                                                      value="/theme/images/btnUpload.gif" style="border:0;cursor:pointer"></hx:graphicImageEx>
                                                 <j4j:idProxy id="proxy_HD_COMMAND_" />
                                            </h:commandLink></td>
                                            <h:inputHidden id="dtSize"
                                                 value="#{pc_BPSMacro.fileDetailsList.clicked}">
                                                 <j4j:idProxy id="proxy_clicked_" />
                                            </h:inputHidden>
                                       </tr>
                                  </tbody>
                             </table>
                             <j4j:idProxy id="proxy_form_main_" />
                        </h:form>
                   </td>
                   </tr>
              </table>
         </hx:scriptCollector>
    </f:view>
    ================== END: FACES JSP FILE: BPSMacro.jsp ========================
    2:
    =================== Action event in the Page Code: BPSMacro.java ============
    public String doIdUpload1Action() {
              System.out.println("PageCode");
              FacesContext context = FacesContext.getCurrentInstance();
              BPSMacroDetailsDataBean fileDetails = (BPSMacroDetailsDataBean)context.getApplication().createValueBinding("#{fileDetails}").getValue(context);
              BPSMacroListDataBean fileDetailsList = (BPSMacroListDataBean)context.getApplication().createValueBinding("#{fileDetailsList}").getValue(context);
              PortletSession sess = (PortletSession)context.getExternalContext().getSession(false);
              sess.setAttribute("BPS_MACRO_CONTEXT", context, PortletSession.APPLICATION_SCOPE);
              sess.setAttribute("BPS_MACRO_FILE_DETAILS", fileDetails, PortletSession.APPLICATION_SCOPE);
              sess.setAttribute("BPS_MACRO_FILE_LIST", fileDetailsList, PortletSession.APPLICATION_SCOPE);
              HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
              boolean isMultipart = ServletFileUpload.isMultipartContent(request);
              request.getContentType();
              return "gotoBPSMacro";
    ============== END Of Page Code Action event ==============================
    3:
    ============== doView() Portlet method ================================
    public void doView(RenderRequest arg0, RenderResponse arg1)
         throws PortletException, IOException {
              String METHOD_NAME = "doView(RenderRequest arg0, RenderResponse arg1)";
              Logger.debug(this.getClass(), METHOD_NAME, "Entering BPSMacroPortlet");
              FacesContext context = FacesContext.getCurrentInstance();      
              PortletSession sess1 = arg0.getPortletSession(true);
              BPSMacroDetailsDataBean fileDetails = new BPSMacroDetailsDataBean();
              BPSMacroListDataBean fileDetailsList = new BPSMacroListDataBean();
              context = (FacesContext)sess1.getAttribute("BPS_MACRO_CONTEXT", PortletSession.APPLICATION_SCOPE);
              if(context != null){
                   fileDetails = (BPSMacroDetailsDataBean)sess1.getAttribute("BPS_MACRO_FILE_DETAILS", PortletSession.APPLICATION_SCOPE);
                   fileDetailsList = (BPSMacroListDataBean)sess1.getAttribute("BPS_MACRO_FILE_LIST", PortletSession.APPLICATION_SCOPE);
              sess1.removeAttribute("BPS_MACRO_CONTEXT", PortletSession.APPLICATION_SCOPE);
              sess1.removeAttribute("BPS_MACRO_FILE_DETAILS", PortletSession.APPLICATION_SCOPE);
              sess1.removeAttribute("BPS_MACRO_FILE_LIST", PortletSession.APPLICATION_SCOPE);
              HttpServletRequest servletRequest = (HttpServletRequest)arg0;
              PortletRequest pReq = (PortletRequest)arg0;
              HttpServletResponse servletResponse= (HttpServletResponse)arg1;
              System.out.println("\n\n Content Type" + servletRequest.getContentType());
              try{
                   if(context != null){
              boolean isFileMultipart = ServletFileUpload.isMultipartContent(servletRequest);
              System.out.println("\nFILE TO BE UPLOADED IS MULTIPART ? " + isFileMultipart);
              if(isFileMultipart){
                   FileItemFactory factory = new DiskFileItemFactory();
                   ServletFileUpload upload = new ServletFileUpload(factory);
                   List items = upload.parseRequest(servletRequest);
                   Iterator iterator = items.iterator();
                   while (iterator.hasNext()) {
                        FileItem item = (FileItem) iterator.next();
                        InputStream iStream = item.getInputStream();
                        ByteArrayOutputStream ByteArrayOS = new ByteArrayOutputStream();
                        int sizeofFile =(int) item.getSize();
                        byte buffer[] = new byte[sizeofFile];
                        int bytesRead = 0;
                        while( (bytesRead = iStream.read(buffer, 0, sizeofFile)) != -1 )
                             ByteArrayOS.write( buffer, 0, bytesRead );
                        String data = new String( ByteArrayOS.toByteArray() );
                        int k = 0;
                        //Check if the file is Refund or Premium
                        int dynamicArraySize = 0;// = st2.countTokens() * 9;
                        dynamicArraySize = st2.countTokens() * 9;
                        if (!item.isFormField() ){
                             File cfile=new File(item.getName());
                             String fileName = "";
                             String separator = "\\";
                             int pos = item.getName().lastIndexOf(separator);
                             int pos2 = item.getName().lastIndexOf(".");
                             if(pos2>-1){
                                  fileName =item.getName().substring(pos+1, pos2);
                             }else{
                                  fileName =item.getName().substring(pos+1);
                             File fileToBeUploaded=new File("C:\\Sal\\BPS MACRO\\FileTransfer\\Desti", fileName);
                             item.write(fileToBeUploaded);
                             validate.displaySuccessMessage(context);
              }catch(Exception e){System.out.println(e);
              Logger.debug(this.getClass(), METHOD_NAME, "Leaving BPSMacroPortlet");
              super.doView(arg0, arg1);
    ==== END: doView method in the portle class. ================================
    Thanks.

    one more question. Is there a way where I can submit two forms ?
    Thats is submit 2nd form only when the first form is submitted.
    I tried this it works.
    function formSubmit(){
    document.form1.submit();
    alert();
    document.form2.submit();
    But If I dont put an alert(basically it disables the parent page) in between, only the second form is submitted.
    If I put a delay of say 3 seconds in between then it will throw a SOCKET CLOSED error in the code triggered due to first form submit.
    Thus disabling the paresnt page for a few seconds is reolving my problem.
    Any ideas ?
    Well Basically when the Alert pop's up the parent page "STALLS" and thus the form2 does not submit till I click on OK, Is there a way I can stall the browser/Parent JSP page using JAVA SCRIPT ??
    Edited by: hector on Oct 9, 2007 11:09 AM
    Edited by: hector on Oct 9, 2007 2:12 PM

  • Expose Photo Gallery: Uploading Problems Using Mac

    Hello All,
    First post, sorry to say it's about a problem I'm having.  I have a Joomla based website and I'm using the Expose Flash Gallery as an image gallery solution on my photography site: http://www.wakinglifephoto.com/
    The plugin works great on the front end, my problem only occurs when managing albums on the backend, which is also based on Adobe's Flash Player.
    Whenever I try to upload a photo on my Mac, the process stalls and never completes.  If I'm using a Windows PC, everything uploads fine.  I've talked with the people who make this gallery plugin and they say it has to do with a bug that is only found in the Mac version of Flash Player.
    Is there any type of solution available for this problem, or do I have to wait and hope that it gets fixed in Flash 10.1?
    TIA.

    The Fascinate has SD card capability, so I would save all my photos to a micro SD card, and then use a reader to transfer them to your computer.

  • Material Master upload problem (LSMW)

    Hi
      I am using Standard Batch input program (RMDATIND)  for MM upload i need to validate the old material number if it is already existed in MARA it should throw an error at the end of the processing saying that "Old material number" already existing in MARA . Flat file will have thousands of records.
    One solution like, we can move all the error records in one internal table in code of Filed mapping conversion rule step , but the problem is where we can write the error records?
    Another question when we use Standard program for conversion is it possible to show error log at the end of the processing?
    Its very urgent  Kindly help me ........
    Rgds,
    bhanu.......

    Hi,
      YOu can populate error messages in LSMW. To achieve this you add code in LSMW.  Follow the below procedure to add code in LSMW.
    In Display FieldMapping and Conversion rule Step of LSMW click the button Display Variant. A screen will pop up. Check the boxes - Global Definitions and ABAP Sub Programs. This will allow you to add code in LSMW.
    At check the error records follow the below mentioned procedure...
    <b>Error messages in the conversion log</b>
    How can user-defined error messages be added to the conversion log?
    1.     Use of  WRITE  command in the Coding
    a.     Example: WRITE: ‚Error during conversion of field xxx’
    2.     In the editor use ‚Insert -> Message’ to use a message already existing in the SAP system.
    a.     Example (Coding after using the menu function and filling the fields):
    WA_ERRORTAB-ID = '/SAPDMC/LSMW'.
    WA_ERRORTAB-MSGNO = 012.                         
    WA_ERRORTAB-PAR1 = 'A'.                          
    WA_ERRORTAB-PAR2 = 'B'.                          
    WA_ERRORTAB-PAR3 = 'C'.                          
    WA_ERRORTAB-PAR4 = 'D'.                          
    INSERT WA_ERRORTAB INTO TABLE G_ERROR_TAB. 
    The message will be added to the log.
    For further reference click the link below
    http://www.erpgenie.com/sapgenie/docs/Lsmw.zip.
    Regards,
    Vara

Maybe you are looking for

  • Calling a library function node much faster than labview code?

    Hi,  I wrote a labview routine to perform a multiple tau autocorrelation on a large array of integers.  A multi tau autocorrelation is a way to reduce the computation time of the correlation but at the expense of resolution.  You can taylor the multi

  • Regarding texts language after extracting texts from R/3.

    Hi, i had created datasource and by scheduling infopackage i had extracted texts to BW for a particular field. now the problem is that when i see the extracted data in BW, i could only see one language at a time. i mean to say that in the selection s

  • Importing calendar into iCloud on a Windows PC

    I cannot figure out how to import my calender en masse from Google. I have a Windows (7) PC and an iPhone (6) on iOS 8. I do not have a Mac I have Google contacts in iCal (.ics) format. I have an iCloud account. I have observed the following problems

  • Missing .abr (brushes) files

    I'm using Photoshop CS6. My problem is in loading new brushes. When I click the 'load brushes' option, Photoshop navigates to a file location that appears to be the "Brushes" folder, but it has only two files in it, both of which I created using the

  • How to Transfer vids to Phone without Bluetooth or...

    How to Transfer vids to Phone without Bluetooth or Connector?? Don't tell me to go buy a connector and don't ask me why not. I just want to know how to do it without those two.