Urgent help needed---File upload using struts
can anyone helpme out on how to perform FileUpload operation using struts
deepak
Hi,
You should use<html:file> tag for uploading file through struts. And make sure that in form bean u need to manipulate this property with FormFile type. provide getter and setter in form bean for this one and manipulate it in your action class.
let me know if u have any further issue..
Tushar
Similar Messages
-
File Upload using struts and jsp
Hi,
Anybody have sample coding for uploading files into the database using struts and jsp.
Thanking you in advance for providing the sample coding.
VeenaHi Veena,
In Strutsconfig.xml you have to configure data sources like this
**************strutsconfig.xml******
<data-sources>
<data-source
type="org.apache.common.dbcp.BasicDataSource">
<set-property property="driverClassName"
vlaue="oracle.jdbc.driver.OracleDriver"/>
<set-property property="url" vlaue="jdbcracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID =ORCL)))"/>
<!-- <set-property property="url"
vlaue="jdbcracle:thin:@127.0.0.1:1521:ORCL"/>-->
<set-property property="username"
vlaue="scott"/>
<set-property property="password"
vlaue="tiger"/>
</data-source>
</data-sources>
Now here is how to get data source
public class LookupAction extends Action
public Double getQuote(String symbol,
HttpServletRequest request)
throws Exception
Double price=null;
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
DataSource dataSource=null;
try
dataSource = getDataSource(request);
conn= dataSource.getConnection();
stmt= conn.createStatement();
rs= stmt.executeQuery("select * from stocks where" + "symbol='" + symbol +"'");
if (rs.next())
=======================
After you can use the coding what I posted earlier.
For that you need to create a table with attachment as a CLOB col.
then with prepared statement I am setting value .
Plz try your self every thing ok you can get that.
all the best
bye
sudheen -
File upload using Struts and hidden field
Hi,
I have seen many examples to upload file using <html:file> tag. But my request is how to upload file using hidden form field and ActionServlet.
I want to upload image without using Browse button options, through hidden field i will set the image file path and will upload to server using ActionForm.
Please help me friends to solve this new issue,
regards,'
dhaya.That's not possible.
If it was, it would be a huge security hole. What about mailicious websites with hidden field which points to "c:/my documents/passwords.txt" and automatically submits the form using Javascript?
Consider a signed applet instead. If it is unsigned then you'll get a security popup "Do you trust this software?" anyway. -
I am a new servlet programmer.......
iam using tomcat server......
can any one pls help in writing code for file upload using servlets and jsp without using multipart class or any other class like that....
Please URGENT..Slow down! "Urgent" is from your perspective alone. I, myself, am not troubled or worried in the least.
hi ugniss
thanks for ur reply....sorry i was not
y i was not asked not to use multipart class or any
other class like that...is there any other
possibility to do file uploading from jsp to
servlet...
Just as an aside, a JSP is a Servlet. But even if I move beyond that, the question does not make sense. If you want a "JSP to upload to a Servlet", then simply do so in memory. You are still (likely) within the same scope of a given request. However, if instead you are referring to a JSP that is displayed on a browser, then really you are talking about HTML, which is what the browser will receive. And since you are now talking about a browser, your only real, viable option is a multi-part file upload. So, it is either server or it is browser. And either way, the question leads to very established options, as outlined above.
the main concept is.. in the browser the user selects
a particular file and clicks the button upload..after
clicking upload the jsp should sent the file to the
servlet in streams...there the servlet gets in and
saves in a server location........this is wat i hav
to do...
Okay. So, after reading my previous (redundant) paragraph, we have arrived at the crux of the issue. You have a JSP that will be output as HTML to a client (browser) which you want to upload content to your server (handled by a Servlet). So, you are now stuck again with multi-part. The requirement to not use multi-part is non-sensical. You can overcome it, say, if you write your own applet or standalone Swing client. However, if your users are invoking this functionality from a browser, you are limited by the options that W3C has provided you. Use multi-part.
is there aby possibilty to do this.....can any one
pls help....Take the advice to download and review Jakarta Commons FileUpload. Inform your management that their requirement makes no technical sense. Research on your own. There are dozens of examples (and tutorials) on file upload using multi-part. Embrace it. Live it. Love it.
- Saish -
Urgent help needed, can I restore N900 Backup file...
i owned a N900 (now sold out)
before selling i took backup of contacts from backup restore option in application section
now i bought a N8 but i m not able to restore my contacts
1. is there any way to restore them in N8?
2. if not, can i convert them in TEXT or any readable format
urgent help needed
thanks in advanceThe backup procedures built into the phone are only designed for restoring to the same phone (ie: in case or data corruption, software update or repair etc.), they can't usually be used to restore to a phone with a different operating system.
You should have backed up with Ovi Suite before selling the N900, that would have been able to restore to the N8. -
Urgent help needed - new to Macs, accidently cut and paste over top of photo folder and now no sign of folder or file, no auto back-up in place, how can I restore photos pls
Thanks for prompt reply, yes we have tried that but have now closed down the browser we where the photos were.
We haven't sent up time machine, do you know whether there is any roll-back function on a Mac?
Thanks -
URGENT HELP NEEDED ... Tomcat Realm and JRE1.4 plug-in problem
I have tried the Security Realm of Tomcat. Since I do not have
an LDAP server, I decided to use the Tomcat-users.xml file in
Tomcat\conf directory.
I added the following lines of code in the web.xml file.
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- NOTE: This role is not present in the default users file -->
<role-name>webviewer</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Tomcat Manager Application</realm-name>
</login-config>
The <role-name> "webviewer" is added into "Tomcat-Users.xml" as the following:
<tomcat-users>
<user name="test" password="password" roles="webviewer" />
</tomcat-users>
So, now when we type the url: http://localhost:8080/adbpdbre/default.htm, TOMCAT shows a dialog box asking for UserName: and Password:Now, only when we give the username and password, it shows the page. This is exactly what we want.
But the problem now is, this default.htm page, has 5 links to 5 applets. The first time that I click on one of these links, the JRE plug of 1.4 shows a dialog again asking for the username and password. Till I dont provide the username and password the system doesnt go ahead and applet doesnt load. I do not want the JRE to ask me for the username/passwords again..How to avoid this ?
Can you give me some more information on this. Ultimately in the production usage, we will be using LDAP and not Tomcat's memory realm.
URGENT HELP NEEDED ... I need to get back to my client on this.
Help would be v. much appreciated.In the config file, you 're essentially saying that you want Tomcat to prompt for usr/passw on every request (url-pattern = /*) made by a 'webviewer', and that's exactly what Tomcat is doing.
Consider using specific url-patterns & roles for resources to be protected. If for now, all you need is to protect the first page, use a more specific url-pattern.
Just an advice : if you'll be using LDAP in production, do not waste time with Tomcat's Security Realm and the BASIC authentication type, since the two have not much in common. Start reading doc on LDAP, and code a prototype, or even better, a vertical slice of the app (i.e a proof of concept). -
Help with file upload Actionscript
I am trying to do a file upload using Actionscript and a
modified version of the tutorial found at:
http://tutorials.lastashero.com/2005/10/creating_a_file_upload_applica.html
When I call the function
fileRef.upload("
http://www.imgthis.com/upload_loader.php");
should that go to that page once it finishes, or how do I
force Flash to redirect the browser to that page passing the
uploaded file?
What am I missing here, or what else would anyone need to
help me?
Any help would be greatly appreciated thanks in advance!
Joshua AbtsIt seems as though the page is not being loaded after the
ActionScript upload command.
Why would my PHP script not be called from the upload
ActionScript? I even just did a simple one line redirect to see if
the PHP script was even being called and it didn't work.
What is the basis for getting the script to send the picture
to the PHP script as a post and using the $_FILES array?
Thanks,
Josh -
Urgent help needed!! Layout table and Draw layout cell dissapeared.
I need some urgent help. I'm using CS3 but for a while my
Layout Table and Draw Layout Cell icons appear greyed and can't use
them at all. Is there any kind soul out there who knows how to fix
this? I'm going nuts trying all the possible options but none seem
to work.
Help please!!!!!!> How would you about designing a page without using html?
You don't. But I don't recall suggesting that you not use
HTML. I just
suggested that you use best-practice HTML, no? Or maybe you
meant to ask
how you would go about building your site without learning
HTML? In that
case, I think you are outta luck. Using DW without knowing
HTML is a very
punishing experience, I'm afraid.
> PS: A virtual box of 12 bottles of Moet Chandon is
already on your way!!
I'd prefer Cristal, please.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Untersberg" <[email protected]> wrote in
message
news:g4tj9a$m5o$[email protected]..
> Ahhhhhh!!!!! They came up!!!! They came up again!!
> I was on standard mode. Now going back to your
suggestion, which I really
> appreciate. How would you about designing a page without
using html? I'm
> just
> redesigning my website at the moment and need it to get
going urgently,
> hence
> the reluctance to start learning HTML at the moment.
I'll do after but I
> need
> to get this up and running fairly quickly.
>
> Cheers.
>
> PS: A virtual box of 12 bottles of Moet Chandon is
already on your way!!
> -
URGENT HELP NEEDED - iPhone 3Gs no longer detected or charged by MacBook
My iPhone 3Gs (3.1) has been running fine, until several hours ago today, when I plugged it to my MacBook, the iPhone is no longer detected - it doesn't show up in iTunes, nor it is charged. I tried opening iPhoto, and it wasn't there too. Not with Image Capture too. I tried charging it using the out-of-box wall charger using the same out-of-box USB cable I use for MacBook, and it can be charged without any problem. Then I put it into Recovery mode, and there iTunes can see it. I don't want to restore it before I figure out exactly what went wrong, as I don't want the restore process somehow gets stuck in the middle that the connection is lost again.
I've tried reinstalled iTunes, including completely removal of Apple Mobile Device Support, as instructed by Apple. But still no luck.
I've tried switching to another USB port of my MacBook. No luck.
My iTunes is the latest 9.0.1, and my Mac OSX is 10.6.1. My iPhone is on 3.1, upgraded from 3.0.
I've read from web that it seems I'm not the only one out there having this problem. But none of them seem having any real working solution.
Urgent help needed & appreciated. Millions of thanks in advance.
Gary1. I used both cables - theirs & mine ... and on several macs
2. yes, same cable for wall & mac
3. as said, i did completely remove & install itunes (incl. apple mobile device support), as instructed on the apple webpage
anyway, did a restore just now. it seems okay now. but the problem is i have no idea what cause this, and i can't replicate the problem. so i don't know when it will happen again ... maybe a bug with os 3.1 ... others on web said os 3.1 is quite buggy ... -
Urgent help needed with un-removable junk mail that froze Mail!!
Urgent help needed with un-removable junk mail that froze Mail?
I had 7 junk mails come in this morning, 5 went straight to junk and 2 more I junked.
When I clicked on the Junk folder to empty it, it froze Mail and I can't click on anything, I had to force quit Mail and re-open it. When it re-opens the Junk folder is selected and it is froze, I can't do anything.
I repaired permissions, it did nothing.
I re-booted my computer, on opening Mail the In folder was selected, when I selected Junk, again, it locks up Mail and I can't select them to delete them?
Anyone know how I can delete these Junk mails from my Junk folder without having to open Mail to do it as it would appear this will be the only solution to the problem.Hi Nigel
If you hold the Shift key when opening the mail app, it will start up without any folders selected & no emails showing. Hopefully this will enable you to start Mail ok.
Then from the Mail menus - choose Mailbox-Erase Junk Mail . The problem mail should now be in the trash. If there's nothing you want to retain from the Trash, you should now choose Mailbox- Erase Deleted Messages....
If you need to double-check the Trash for anything you might want to retain, then view the Trash folder first, before using Erase Junk Mail & move anything you wish to keep to another folder.
The shift key starts Mail in a sort of Safe mode. -
IPhone 4 reset itself, photos lost -URGENT HELP NEEDED
Hi there,
Urgent help needed!!
Tonight I was taking extremely important photos throughout an event on my iPhone 4, however, my iPhone 4 ran out of battery once I was near a charger I plugged it in and for some reason my iPhone had reset itself. Back up icloud options were from yesterday, but the photos that I was taking at the event are needed urgently. Is there any way possible I can recover the photos that were taken?
Thanks in advance!!!!Slymm71 wrote:
just had similar problem got email from find my phone saying initiating full phone wipe this cannot be stopped ***? i own the phone from new and registerred in m name but wiped whilst i was using it !!!
See your other post...
https://discussions.apple.com/message/18876037#18876037 -
Computer restarts when ipod is connected urgent help needed
alright this is weird, I've had my ipod for ages and suddenly I go to plug it in and the computer slows down really really really slow and eventually just turns it self off, restarts and then sits in a black screen. if I leave the ipod plugged into the computer and restart it again it just goes straight back to the black screen, but both my ipod and computer work fine when there not connected. i have the latest version of itunes which seemed to help the first time i tried it actually started to update the ipod but then guess what the computer has another heart attack. urgent help needed please!!!
if I leave the ipod plugged into the computer and restart it again it just goes straight back to the black screen
Given this, I'd put it down to a flaky power supply in the computer. Might want to try using another computer or replacing the PSU. -
File uploads using servlets to oracle8i database
Hi,
Help please, How I can a File Upload using BLOB's into the oracle database, any sugestions...
Thanks
Moacyr
[email protected]Try the jason hunter book Java Servlet Programming for a very good description or the web site hosted by o'reilly
www.servlets.com
Has a very neat java class for decoding multipart mime encoded files (the upload stream from the browser). Seems to accomodate most of the differing browsers intretation of the standard.
Note to Oracle: This should really be handled by the servlet engine as an Oracle extension. Where the servlet engine strips the mime encoding out before the servlet is called placing the decoded file in an associated extension call. ie: cast the request to an Oracle request object which has file uploaded method. -
File uploads using jQuery with jquery.fileupload.js fails in Firefox over SSL
Please see the link below where I originally posted the question.
http://stackoverflow.com/questions/27792614/file-uploads-using-jquery-with-jquery-fileupload-js-fails-in-firefox-over-sslThanks. In my estimation that is exactly the issue. But that doesn't help with a resolution.
The actual file size: 945,991 bytes
If Firefox is miscalculating the length (in Safari/Chrome 945991 and 946241 in Firefox), then Firefox is reporting erroneously and should be raised as a bug in Firefox, would you agree?
Maybe you are looking for
-
PC based iPod connected to Mac no longer works
I was told that I could connect my PC based iPod mini to a Mac without doing anything in order to listen to my music at work where we use Macs. The second I plugged the USB in the iPod went dead and the Mac restarted (now the computer seems to restar
-
Hi All, I have uplaoded INLK data into SAP. Now my requirement is to download the same data from SAP (table name : 558B) and give that to user to confirm. Can any buddy tell me how to do this.. I have options like downloa
-
Importing a model from a configurator to a custom table
Hi, I'm new to Configurator. Can someone please advice in detail how to import all possible combinations from a model in the configurator to a custom table? I have created a custom table based on the items in the model. I have also written a CIO whic
-
Locale aware Tree labelFunction
Hi all I'm in need to implement tree labelFunction that is locale aware, here is the example : class Localization{ public function setLocale(locale:String):void{ this.dispatchEvent(localizationChangeEvent); [Bindable(event="localizationCh
-
Oracle Reports(Character Mode) issue with 17 CPI ---URGENT
Hi, I am in-process of Character Mode report development for Purchase order. Report is working perfectly with Font Courier and 10CPI. Now Client wants report with 17 CPI; when I changed the setup at printer level to 17CPI; my report content got shrin