![]() ![]() I figured all I had to do was supply a file to writeTo, so that writeTo would write to that file.So I modified the example servlet code (DemoParserUploadServlet.java) to do this.String outFileName = dirName + '/' + xyzUpLoadUser + '/' + name + ' + getTS + '.dat' file = new File( outFileName ) size = filePart.writeTo(file). If this part doesn't contain a file this method does nothing.Returns: number of bytes writtenThrows: java.io.IOException - if an input or output exception has occurred. ![]() If the user supplied a file, we write it to that file, and if they supplied a directory, we write it to that directory with the filename that accompanied it. ![]() These packages include several classes, such as all of. Friends,I am trying to write a upload with .The problem I am having is specifiying the name of file on the server's side.When I looked at the documentation for .servlet.multipartClass +.Part +.FilePartwriteTopublic long writeTo(java.io.File fileOrDirectory) throws java.io.IOExceptionWrite this file part to a file or directory. A JAR file named cos.jar includes the and packages. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |