How to upload the file without using java components?
Hello,
I need to upload the file using JSP, but I don't want to use java componets(such as
jspsmart).
Who can tell me how to realize it? This issue is very important to me,
thanks all in advance!
make you're own servlet using the multipartrequest from o'reilly.
easy and simple, no jspsmart, only 1 jar file and some descent programming.
I use it like that...
Similar Messages
-
Regarding reading the data from the files without using Stremas
hai to all of u...
here i have a problem where i have to read the data from the files without using any streams.
please guide me how to do this one,if possible by giving with an example
Thanks & Regard
M.RamakrishnaSimply put, you can't.
By why do you need to? -
how to upload the files from javascipt.can any body send the code for that.
You can't upload files with Javascript, that would be a huge security hole. At highest you can use Javascript to submit a form with a file field, but the user still have to select the file himself.
-
How to import the image by using java application
1.how to import the image by using java APPLICATION and display it on the textarea that you have been created.
2.how to store the image into the file.
3. what class should i used?
4. how to create an object to keep track the image in java application.
* important : not java applet.
plzzzzzzz.
regards fennyfollow the link:
http://java.sun.com/docs/books/tutorial/2d/images/index.html -
Is there any way to force the applet to load the file without using cache?
Hi,
I have the applet that renders some data from a file specified as the parameter. The problem is that the user can do something, that changes the input file and reloads the page, but the applet renders old data (from browser cache most probably)
Is there any way to force the applet to load the file without using cache?
Regards,
ZdenekThe initial view (IV) settings within a PDF file are static tags - they can't be made to dynamically-adapt based on the window dimensions,it's the renderer (Acrobat, Reader, or whatever else is opening the file) that decides if and how it will follow the IV requested by the file header.
It would be possible to use a Page Open action on the first page of the file, which does some nasty math with the various doc.*WindowRect objects to work out how much "wasted" space there is, and then set the doc.layout and doc.zoomType properties - but page actions are a different concept to IV as the zoom will reset itself every time that page is viewed. Users don't like their application apparently fiddling with the zoom level without being told to! -
How to get the context data using java script in interactive forms
Hi All,
How to get the context data using java script in interactive forms by adobe, am using web dynpro java
thanks.Hi venkat,
Please Refer this link.
Populating one Drop-Down list from the selection of another Drop-down list
Thanks,
Raju. -
How to find the File name using the FTP Adapter
hi all,
how to find the File name using the FTP Adapter with BPEL.
RegardsFound the solution for this.
First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
Thanks for the posts -
How to upload the files using struts
Hi all
My requierment is to upload the files from the client machine and save it on the server, the file size must not increase more than 250 MB and to validate that we cannot do validation on the client machine so we have to validate it on the server side. below is my code kindly go through it if there is any problem in Bussiness Logic
1>Upload.jsp
2>UploadForm.java
3>UploadAction.java
*1>Upload.jsp*
<%@ page language="java"%>
<%@ page import="java.io.*"%>
<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
<html>
<body bgcolor="white">
<form name="uploadForm" action="TestApplication/upload" method="post" enctype="multipart/form-data">
<table>
<tr>
<td align="center" colspan="2">
<font size="4">Please Enter the Following Details</font>
</tr>
<tr>
<td align="left" colspan="2">
<font color="red"></font>
</tr>
<tr>
<td align="right">
File Name
</td>
<td align="left">
<input type="file" name="theFile">
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" value="UPLOAD">
</td>
</tr>
</table>
</form>
</body>
</html>*2>UploadForm.java*
package com.MyPack.Datamatics;
import org.apache.struts.action.ActionForm;
import org.apache.struts.upload.FormFile;
public class UploadForm extends ActionForm
private static final long serialVersionUID = 1L;
private FormFile theFile;
public UploadForm(){}
* @return Returns the theFile.
public FormFile getThefile() {
return theFile;
* @param theFile The FormFile to set.
public void setThefile(FormFile theFile) {
this.theFile = theFile;
} *3>UploadAction.java*
package com.MyPack.Datamatics;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
public class UploadAction extends Action
public ActionForward execute(
ActionMapping am,
ActionForm af,
HttpServletRequest req,
HttpServletResponse res) throws Exception{
UploadForm myForm = (UploadForm)af;
// Process the FormFile
FormFile myFile = myForm.getThefile();
String contentType = myFile.getContentType();
String fileName = myFile.getFileName();
int fileSize = myFile.getFileSize();
String data="";
try{
java.io.InputStream fileData = myFile.getInputStream();
String path="E:/store";
File f = new File(path);
java.io.OutputStream outputStream = new FileOutputStream(f+"/"+fileName);
int temp = 0;
byte[] buffer = new byte[8192];
temp = fileData.read(buffer, 0, 8192);
while ((temp) != -1) {
outputStream.write(buffer, 0, temp);
outputStream.close();
data = "file has beeb written to E:/store" + fileName;
fileData.close();
catch (FileNotFoundException fnf)
{ System.out.println("Cannot Found the file");
System.out.println(data);
System.out.println("contentType: " + contentType);
System.out.println("File Name: " + fileName);
System.out.println("File Size: " + fileSize);
return am.findForward("success");
}Thanks in Advance[help link 1|http://www.roseindia.net/struts/strutsfileuploadandsave.shtml]
[help link 2|http://www.roseindia.net/struts/strutsfileupload.shtml] -
How to list the datasources without use a tnsnames.ora file?
Hi,
I want to use the OracleDataSourceEnumerator class of ODP.Net to list the datasources on which the user can connect.
It's work with a tnsnames.ora on the local station, so good.
But I want use the easy connect naming methode so i have edited the sqlnet.ora file with this:
NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES)
then i have deleted the content of the tnsnames.ora
so my code don't work : none datasource is returned by the OracleDataSourceEnumerator
So my question : is it a way to list the datasources without use a tnsnames.ora file?
Edited by: user13499556 on 17 déc. 2010 08:21You can check
DataConnectionFile.EnumerateDependants method
This post is my own opinion and does not necessarily reflect the opinion or view of Slalom. -
How to upload the file from website into R/3
Dear Experts,
I want to post the data in r/3 using bdc.but flat file is available in some website for eg.'www.sap.com'.how to retrieve the flat file from the website and how to upload the data from website to r/3.
It is very urgent please help me.
Thanks & Regards,
Ashok.Hi Ashok,
We cannot directly pulled data from website. we need to activate webservices and rfcs. Better you could asked to your Basis guy that he knows or not. If not then do sdn you will get the appropriate answer. I can only say that its possible and we can download from website.
Regds,
Rakesh -
How to upload the files of a directory to a server at one time?
in a jsp page ,the user choose a directory ,then I want to upload the files of the directory to a server at one time.How to do this?Thanks!
You create multiple file input fields and you have them select each file they want.
Or tell the user to zip the directory and upload the zip file.
Or use a signed applet to get all the files and send them.
There's no way for the browser to select a directory. -
How to upload (.txt) file by using GUI Upload?
I tried to upload .csv file in using GUI upload and it works.
THIS IS MY SAMPLE CODE.
CLEAR w_rawfile.
DESCRIBE TABLE i_rawfile LINES v_read. "Counter for records read
Condense w_rawfile-field.
Separate header record from detail records
LOOP AT i_rawfile INTO w_rawfile.
IF sy-tabix = 1. "header is always the first record
SPLIT w_rawfile-field AT ' ' INTO
w_header_file-name1
w_header_file-name2
w_header_file-name3
w_header_file-cntry
w_header_file-address1
w_header_file-address2.
APPEND w_header_file TO i_header_file.
CLEAR: w_header_file.
ELSE. "succeeding records are detail records
SPLIT w_rawfile-field AT ',' INTO
w_inputfile-nachn
w_inputfile-vorna
w_inputfile-nach2
w_inputfile-land1
w_inputfile-stras
APPEND w_inputfile TO i_inputfile.
ENDIF.
IF i try to replace my file into a .txt format. An error occurs. Please kindly give me the code to do this correctlt. ThanX!Reading Data from Presentation Server (Dialog)
To read data from the presentation server into an internal table with a user dialog, use the function module UPLOAD. The most important parameters are listed below. For more information, refer to the function module documentation in the Function Builder (Transaction SE37).
Important Import Parameters
Parameters
Function
CODEPAGE
Only for upload under DOS: Value IBM
FILENAME
Filename (default value for user dialog)
FILETYPE
File type (default value for user dialog)
ITEM
Title for dialog box
Use the FILETYPE parameter to specify the transfer mode. Possible values:
BIN
Binary files
ASC
ASCII files: Text files with end of line markers.
DAT
Excel files, saved as text files with columns separated by tabs and lines separated by line breaks.
WK1
Excel and Lotus files saved as WK1 spreadsheets.
Important Export Parameters
Parameters
Function
FILESIZE
Number of bytes transferred
ACT_FILENAME
Filename (as entered in the user dialog)
ACT_FILETYPE
File type (as entered in the user dialog)
Tables Parameters
Parameters
Function
DATA_TAB
Internal table (target for the import)
Exceptions Parameters
Parameters
Function
CONVERSION_ERROR
Error converting data
INVALID_TABLE_WIDTH
Invalid table structure
INVALID_TYPE
Incorrect FILETYPE parameter
Suppose the presentation server is running under Windows NT, and contains the following Excel file:
If this table is saved as a text file "D:\temp\mytable.txt" with tabs between the columns, the following program can read the table:
PROGRAM SAPMZTST.
DATA: FNAME(128), FTYPE(3), FSIZE TYPE I.
TYPES: BEGIN OF LINE,
COL1(10) TYPE C,
COL2(10) TYPE C,
COL3(10) TYPE C,
END OF LINE.
TYPES ITAB TYPE LINE OCCURS 10.
DATA: LIN TYPE LINE,
TAB TYPE ITAB.
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = 'IBM'
FILENAME = 'd:\temp\mytable.txt'
FILETYPE = 'DAT'
ITEM = 'Read Test for Excel File'
IMPORTING
FILESIZE = FSIZE
ACT_FILENAME = FNAME
ACT_FILETYPE = FTYPE
TABLES
DATA_TAB = TAB
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3.
WRITE: 'SY-SUBRC:', SY-SUBRC,
/ 'Name :', (60) FNAME,
/ 'Type :', FTYPE,
/ 'Size :', FSIZE.
SKIP.
LOOP AT TAB INTO LIN.
WRITE: / LIN-COL1, LIN-COL2, LIN-COL3.
ENDLOOP.
The program displays the following dialog box:
Here, the user can change the default values. When the user chooses Transfer, the system imports the data from the file D:\temp\mytable.txt into the internal table TAB.
The output appears as follows:
SY-SUBRC: 0
Name : d:\temp\mytable.txt
Type : DAT
Size : 69
Billy the Kid
My Fair Lady
Herman the German
Conan the Barbarian
The contents of the internal table TAB are exactly the same as the contents of the original Excel table. -
How to upload the file in the virtual disk?
I have created a virtual drive called Z.But I don't upload file(image).
I could not find how to write the file path.
<cfif len(attributes.background_file)>
<cfset upload_folder =( ".....")">
<cffile action = "upload"
fileField = "background_file"
destination = "#upload_folder#"
nameConflict = "MakeUnique"
mode="777">
<cfset file_name = "#createUUID()#.#cffile.serverfileext#">
<cffile action="rename" source="#upload_folder##cffile.serverfile#" destination="#upload_folder##file_name#">
<cfif isdefined("attributes.old_background")>
<cf_del_server_file output_file="settings/#attributes.old_background#" output_server="#attributes.old_background_server_id#">
</cfif>
</cfif>I adduce that my computer disk screen. if I want to upload file to virtual file system Must I create a RAM disk-based file.Because all codes include ram://?
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSe9cbe5cf462523a0-70e2363b121825b20 e7-8000.html
I aduce my computer disk screen. My virtual disk name is Z.Dou you have any idea abaut this subject.
I apologize to anyone. -
How to send the email without using server side (Php, java)
How to send the (Run time image or file) Email & Attachment in Flex web application. without using php, java.
Well, at some point your email needs to be handed over to an SMTP server. It's a fair amount of work, but if you want to just send an email you could open a socket to a mail server's SMTP port and follow the SMTP protocols to send your email.
ActionScript sockets: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7cf7.html
SMTP protocol: http://tools.ietf.org/html/rfc821
-- Tom -
How Çan I Recover Files Without Using Time Machine?
Before Time Machine, you used to be able to recover files using, I think, one of the utilities.
Now if you search for "recover files" in Help, all the options involve using Time Machine with and without Spotlight.
I don't have a backup drive to use Time Machine yet but I would still like to try to recover an accidentally deleted folder.
How can I do that now without Time Machine?Basics of File Recovery
If you simply put files in the Trash you can restore them by opening the Trash (left-click on the Trash icon) and drag the files from the Trash to your Desktop or other desired location. OS X also provides a short-cut to undo the last item moved to the Trash -press COMMAND-Z.
If you empty the Trash the files are gone. Recovery is possible but you must not allow any additional writes to the hard drive - shut it down. When you delete files you erase only the directory entries, not the files themselves. However, the space occupied by the files has been returned to the system as available for storage. Writing to the drive will then eventually overwrite the space once occupied by the deleted files in which case the files are lost permanently. Also if you save a file over an existing file of the same name, then the old file is overwritten and cannot be recovered.
If you stop using the drive it's possible to recover deleted files that have not been overwritten with recovery software such as Data Rescue II, File Salvage or TechTool Pro. Each of the preceding come on bootable CDs to enable usage without risk of writing more data to the hard drive.
The longer the hard drive remains in use and data are written to it, the greater the risk your deleted files will be overwritten.
Also visit The XLab FAQs and read the FAQ on Data Recovery.
There has never been file recovery software in OS X. Recovering deleted files is not the same as restoring files from a backup. The best way to prevent losing a file is to maintain a backup. Obviously you aren't doing that, so you should consider adopting some kind of backup plan.
Basic Backup
Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
1. Retrospect Desktop (Commercial - not yet universal binary)
2. Synchronize! Pro X (Commercial)
3. Synk (Backup, Standard, or Pro)
4. Deja Vu (Shareware)
5. PsynchX 2.1.1 and RsyncX 2.1 (Freeware)
6. Carbon Copy Cloner (Freeware - 3.0 is a Universal Binary)
7. SuperDuper! (Commercial)
8. Intego Personal Backup (Commercial)
9. Data Backup (Commercial)
The following utilities can also be used for backup, but cannot create bootable clones:
1. Backup (requires a .Mac account with Apple both to get the software and to use it.)
2. Toast
3. Impression
4. arRSync
Apple's Backup is a full backup tool capable of also backing up across multiple media such as CD/DVD. However, it cannot create bootable backups. It is primarily an "archiving" utility as are the other two.
Impression and Toast are disk image based backups, only. Particularly useful if you need to backup to CD/DVD across multiple media.
Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore. Also read How to Back Up and Restore Your Files.
Although you can buy a complete FireWire drive system, you can also put one together if you are so inclined. It's relatively easy and only requires a Phillips head screwdriver (typically.) You can purchase hard drives separately. This gives you an opportunity to shop for the best prices on a hard drive of your choice. Reliable brands include Seagate, Hitachi, Western Digital, Toshiba, and Fujitsu. You can find reviews and benchmarks on many drives at Storage Review.
Enclosures for FireWire and USB are readily available. You can find only FireWire enclosures, only USB enclosures, and enclosures that feature multiple ports. I would stress getting enclosures that use the Oxford chipsets (911, 921, 922, for example.) You can find enclosures at places such as;
Cool Drives
OWC
WiebeTech
Firewire Direct
California Drives
NewEgg
All you need do is remove a case cover, mount the hard drive in the enclosure and connect the cables, then re-attach the case cover. Usually the only tool required is a small or medium Phillips screwdriver.
Maybe you are looking for
-
My 2011 macbook pro kept shutting down and now it won't turn back on.
I have a mid2011 macbook pro and it kept shutting down randomly and now it won't turn back on. No error messages were showing up when it was turning on.
-
I'm trying to update the security settings to a PDF I've converted from a Word document so that my users with Reader version 9 can not only fill in the data fields, digitally sign the document and save it. On the menu, I select, Advanced, Extend Form
-
Continuation message in linked text boxes
Can anyone tell me how or if there is a way to insert an automatic comment in a linked text box informing the reader that the article is (i.e.) continued on pg. 2 - or continued from pg. 1. Microsoft Publisher used to have that feature (may still) an
-
Getting "error in XML task" when trying to check out projects
I get the following error when I try to check out projects on our SAN (where everything is): Here's the error in full: error in XML task: error writing XML document: You do not have appropriate access privileges to save file "002800.xml" in folder "0
-
Saving validation results for later processing
Greetings! I'm trying to come up w/ a way to save validation results (found server side in this.Details.ValidationResults) to an attached entity so that they can be worked by a user at a later time. Has anyone implemented such a pattern? I can't se