Uploading files from a mobile phone
Hello.
I'm trying to do a file uploader via an HTTP-Post Request to send files to a server from java enabled mobile phones using internet... is it possible?.. Some idea?
Thanks in advance for any help, and sorry my English
Daniele
first of all not all the mobile phone support file system if you want to uplaod a file(in form of recordstore) contained within yourt jar file that
will be created after the installation can be uplaoded just open the outputstream connection to server and sumbit it simple as that
Similar Messages
-
How do i upload pictures from my mobile phone to email account?
how do i upload pictures from my mobile phone to my yahoo account?
I'm a little confused as to why you are asking this in a Firefox forum. I think Yahoo might be a better place to ask.
-
How to list video files from the mobile phone?
i need to list all video files from the mobile hone. can any one help me?
Filter for Metadata > File Type > Video and then select them and press delete. Then pick from catalog or disk.
-
How to I upload files from adobe mobile to adobe cloud
Hello,
how do I back up my files from the adobe mobile app from my iPad onto the acrobat cloud so I can save and access the pdf'sfrom any devise? I followed the app help but I couldn't find the links it was telling me to follow.
thank you.
AlisonPerhaps I am using incorrect terminology. I can confirm I have an iCloud account on my Win 7 laptop. In Pages on my iPad I have documents that got there from my laptop. I cannot remember exactly what I did to achieve this but it happened and I wish to repeat the exercise. Thanks for your interest in my problem.
-
How to upload pdf file from windows cell phone?
How to upload pdf file from windows cell phone?
You can do this in steps.. First use the built in method for uploading a file into the flows files object, Next you would copy the file out to an Oracle built directory on your UNIX box using utl_file.put_raw..
Here is a link to show you how to upload files in an APEX application [http://download.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm]
And here is a link to show you how to use utl_file.put_raw.. [http://psoug.org/reference/utl_file.html], item is towards the bottom of the screen..
Thank you,
Tony Miller
Webster, TX -
Problem uploading file from mobile device to tomcat server
Hi guys, here's how it goes.
I'm designing a site using JSP for wireless devices like PDAs, Smartphones etc, basically any mobile device that has browser capabilities. There's a page where the user is allowed to upload a file from the mobile device, which works perfectly fine when I access the site using a PC. But when I try to upload a file from a mobile device, ( I tried using a Nokia 6680 ) , there wasn't any error but the file just wasn't stored in my server.
Here's how the upload form looks like :
<FORM name="filesForm" action="ProcessFileUpload.jsp" method="post" enctype="multipart/form-data">
<font size="1" face="arial">File :</font><br>
<input type="file" name="file1" size="10" style="font-size: 9px;"/><br><br>
<input type="submit" name="Submit" value="Upload Files" style="font-size: 9px;"/>
</FORM>Here's the gist of ProcessFileUpload.jsp:
<%
System.out.println("");
System.out.println("Content Type ="+request.getContentType());
DiskFileUpload fu = new DiskFileUpload();
// If file size exceeds, a FileUploadException will be thrown
fu.setSizeMax(1000000);
List fileItems = fu.parseRequest(request);
Iterator itr = fileItems.iterator();
while(itr.hasNext()) {
FileItem fi = (FileItem)itr.next();
//Check if not form field so as to only handle the file inputs
//else condition handles the submit button input
if(!fi.isFormField()) {
System.out.println("NAME: "+fi.getName());
System.out.println("SIZE: "+fi.getSize());
System.out.println(fi.getOutputStream().toString());
// File fNew= new File(application.getRealPath("/"), fi.getName());
File tempFileRef = new File(fi.getName());
File fNew = new File(filepath.toString(),tempFileRef.getName());
String MM_Overall_DRIVER = "org.gjt.mm.mysql.Driver";
String MM_Overall_USERNAME = "****";
String MM_Overall_PASSWORD = "*********";
String MM_Overall_STRING = "jdbc:mysql://localhost:3306/";
Driver DriverRecordset1 = (Driver)Class.forName(MM_Overall_DRIVER).newInstance();
Connection ConnRecordset1 = DriverManager.getConnection(MM_Overall_STRING,MM_Overall_USERNAME,MM_Overall_PASSWORD);
PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("use " + domain);
ResultSet Recordset1 = StatementRecordset1.executeQuery();
filepath.append("/").append(tempFileRef.getName());
StringBuffer fp = new StringBuffer("insert into ");
fp.append(domain).append(".filepaths (path) values ('").append(filepath).append("')");
PreparedStatement ps = ConnRecordset1.prepareStatement(fp.toString());
ps.executeUpdate();
System.out.println(fNew.getAbsolutePath());
fi.write(fNew);
else {
System.out.println("Field ="+fi.getFieldName());
}Basically I store the file uploaded in the tomcat server and the path of the file is saved in a table in MySQL.
When I upload a file using a PC, the tomcat console displays the content type file name yada yada yada. However, when I upload a file from the Nokia 6680, I get just the content type then things just stop there and nothing else happens. No file name no file size whatsoever. The path of the file is not inserted into MySQL and the file is not stored in the server.
Can anyone please enlighten me on this issue and hopefully gimme a solution to this problem? Your help will be greatly appreciated.-bump-
HELPP!?!?!?!?! -
Accessing a file in a mobile phone
Hi ,
Is it possible to access and read the contents of a text file in a mobile phone using JSP. The regular file select component in JSP is not workin on the phone. when i click on the browse file button it says unable to view this file.
This is the code of the page, i got it from the internet only. This seems to work properly if it runs on a PC, but when i try it on a mobile it is not able to select the file.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form ENCTYPE="multipart/form-data" action="single_upload_page.jsp" method="POST">
<input type="file" name="selection" value="" />
<input type="submit" value="submit" />
</form>
</body>
</html>
------ > single_upload.jsp
<%--
Document : show
Created on : Nov 26, 2008, 3:25:30 PM
Author : root
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.io.*,java.io.File, org.apache. commons. io. *" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
//to get the content type information from JSP Request Header
String contentType = request.getContentType();
if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {
DataInputStream in = new DataInputStream(request.getInputStream());
//we are taking the length of Content type data
int formDataLength = request.getContentLength();
byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;
//this loop converting the uploaded file into byte code
while (totalBytesRead < formDataLength) {
byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
totalBytesRead += byteRead;
String file = new String(dataBytes);
out.print(file);
//for saving the file name
String saveFile = file.substring(file.indexOf("filename=\"") + 10);
saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
int lastIndex = contentType.lastIndexOf("=");
String boundary = contentType.substring(lastIndex + 1,contentType.length());
int pos;
//extracting the index of file
pos = file.indexOf("filename=\"");
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
int boundaryLocation = file.indexOf(boundary, pos) - 4;
int startPos = ((file.substring(0, pos)).getBytes()).length;
int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
// creating a new file with the same name and writing the content in new file
FileOutputStream fileOut = new FileOutputStream("/root/Desktop/"+saveFile);
fileOut.write(dataBytes, startPos, (endPos - startPos));
fileOut.flush();
fileOut.close();
%><Br><table border="2"><tr><td><b>contents of the file:</b>
<% out.println(saveFile); %></td></tr></table> <%
%>
</body>
</html>Disclaimer: your code is unformatted and thus hard to read, so I have't read it thoroughly.
In the future please use tags to post the code in. You can get them by pressing the CODE button in the toolbar of the message editor toolbar.
ram.west wrote:
Is it possible to access and read the contents of a text file in a mobile phone using JSP. The regular file select component in JSP is not workin on the phone. when i click on the browse file button it says unable to view this file.So this error message immediately pops up when you press the 'browse' button? What's the exact error message? Have you tried another mobile webbrowsers as well?
This is the code of the page, i got it from the internet only. I highly recommend you to use the thoroughly developed, tested and maintained library Apache Commons FileUpload. Here is its homepage: [http://commons.apache.org/fileupload]. Checkout the 'User Guide' and 'Frequently Asked Questions' sections for code samples and a lot of tricks.
This seems to work properly if it runs on a PC, but when i try it on a mobile it is not able to select the file.You need to exclude either the client side or the server side from being suspect. Answer the questions I asked before. -
How to upload file from a client machine to server machine
hei evryone!
can anyone pls help me on how i can upload file from a client machine to another machine (or server). using jsp.Then later on, i can also retrieve the names of these files to place it as values for option tag in an html form.I have a seperate screen for uploading the file and the screen for displaying all the files that were uploaded on the server...
any sample code/ ideas would be much appreciated.Thx!!!!hei evryone!
can anyone pls help me on how i can upload file from a client machine to another machine (or server). using jsp.Then later on, i can also retrieve the names of these files to place it as values for option tag in an html form.I have a seperate screen for uploading the file and the screen for displaying all the files that were uploaded on the server...
any sample code/ ideas would be much appreciated.Thx!!!! -
How to upload file from client to server in servlets.
actually in my application i have to upload file from client m/c to server.
it is not possible through file i/p stream as fileStreams does not work on network. Please mail me if you have any solution to this.
Thank's in advance............Haii roshan
Pls go through this thread..
http://forum.java.sun.com/thread.jspa?forumID=45&threadID=616589
regards
Shanu -
How to upload file from Application Server?
Dear Friends,
How to upload file from Application Server?
Plz. with example...
Regards,
Dharmeshhi,
check the code for upload from application server.
tables: kna1.
types: begin of s_file,
customer type kna1-kunnr,
country type kna1-land1,
name type kna1-name1,
region type kna1-regio,
end of s_file.
*--Internal tables
data: it_file type s_file occurs 0 with header line.
*-- Selection screen
selection-screen: begin of block b1 with frame title text-001.
parameter: p_file type rlgrap-filename default 'C:/customer.txt'
obligatory.
selection-screen: end of block b1.
*-- At selection screen
at selection-screen on value-request for p_file.
perform file_help using p_file.
*-- Process File
start-of-selection.
perform upload_file using p_file.
*-- write File data to o/p
end-of-selection.
perform write_data.
*& Form file_help
form file_help using p_p_file.
data: l_filepath type ibipparms-path.
call function 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
importing
file_name = l_filepath
p_p_file = l_filepath.
endform. " file_help
*& Form upload_file
form upload_file using p_p_file.
call function 'WS_UPLOAD'
exporting
filename = p_p_file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = it_file
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
others = 11
if sy-subrc <> 0.
message i001.
endif.
endform. " upload_file
*& Form write_data
form write_data .
loop at it_file.
write:/ it_file-customer, it_file-country, it_file-name,
it_file-region.
endloop.
endform.
regards,
keerthi. -
How can i upload files from one ip address to another ip address machine ?
how can i upload files from one ip address to another ip address machine ?
i need to copy files from one client m/c to server m/c like sftp
please suggest solution on this -
Unable to upload files from local computer to remote server (Was: Dreamweaver)
I have lost the connection between the remote location and the local location for files on my computer. Where to I correct this issues, since I cannot upload files from local to remote. Host server from server to my computer works fine, Running Dell computerr XP operating system with CS3 Dreamweaver. Need all the help I can get.
I am now having a "ftp error - cannot make connection to host. Dreamweaver
encoutered a netwoerk or file system error. I did as you suggested and I
get to basic site definition, ( which looks o.k.), next screen ( no,I do
not want to use a server technology) Next screen ( edit local copies on my
machine ( file location looks o.k.), next screen (connect to remote
server=ftp) address of web server is correct, ( no folder on server, or ftp
login or ftp password) do not enable check in or check out
summary: local
Site name:midhba
local root folder:midhba
remote info:
access; ftp
FTP host: midhba.com
check in.check out diabled
testing server (set up later) -
Uploading files from web to db server
hi, yesterday discover article from otn about uploading file from clients filesystem to web application server.
but how about uploading from clients filesystem directly into database column? (i'm talking about forms application via web server, btw, not c/s app)
i've search through the archieve, but cant find anything useful, just alot of similar question with no useful answer. so i guess alot of people could use this feature, if it can be done.
thanks in advance
PhilThe demo titled "Forms, Reports, and Portal Integrated Demo"
has the package and a form using it.
You can download it from http://technet.oracle.com/sample_code/products/forms/content.html
Read the script and search the part where you upload an image. -
How to get InputStream of uploaded file from request?
The situation:
Client is uploading xml file to server.
<form METHOD=POST ENCTYPE = "multipart/form-data" action="SendFile" accept="text/xml">
<input type="file" name="SentFile" />
<input type="submit" value="go"/>
</form>Then I need to parse data from file.
I want to use method javax.xml.parsers.DocumentBuilder.parse(InputStream is)
But, how to get InputStream of uploaded file from request?You cannot get the InputStream of the uploaded file directly. The InputStream you can obtain from request.getInputStream() contains a lot of other data as well as the uploaded file. You will have to parse the data in the InputStream to find the data that belongs to the file.
A short cut is to use the HTTP Multipart File Upload available from www.jenkov.com. It simplifies file upload and makes it easy to obtain an InputStream for only the uploaded file. It also handles upload of multiple files. It is free, open source, Apache license, so if it doesn't fit your needs, you can always read the code and see how it works. Then write your own upload servlet. -
Writing files to a mobile phone
Can you write text to a file on a mobile phone? I have Sony Ericcision K608i. There is a PDA optional package but this will not work. Are you able to attach something to a mobile phone so it will write text?
Click on the file's icon. Hold down the option key and drag the file to the icon that represents the disk to which you want to copy the file.
Maybe you are looking for
-
Confused about imessage and apple account
So I just got my own icloud account. I used to share one with someone else but now I got my own. First, is the icloud account the same as apple account? Like is the apple store account the same as the icloud account?? Second, since I got this new acc
-
Arabic Characters not displaying properly in SQL+ Enviorment
Hi, I have Oracle 8i ,I am able to insert and view arabic characters properly from asp and asp.net application but whenever i tried to run sql scripts to fetch arabic data it displays only reverse'?'sign in place of all characters ..... Is there any
-
Can I use JMQ 2.0 in a java application?
Is it possible to have a stand alone iMQ client? I have a requirement where one of my applications which needs to communicate with iMQ runs on a different machine than the iMQ itself. I also need to have a separate JNDI repository for this applicatio
-
Sync the FS Item (CX 13) Master data in QA systems
I have requirement like this, Synchronize all new FS Items (T-Code CX13) from production to the QA and Development environments, on average there are approximately 20 new FS Items set up in a month. ( this is the reson to do this: The weekly job to u
-
Communication between different JVM in one computer
hi I need to communicate a java program with another java program, I use a file to realize this. But my two program should read the file periodicaly, I use timer. But it is not good. It will ocuppy some CPU time. I look for some good way in JDK DOC,