need help to store many documents from a java web app - java

i have a little issue. I hava to generate thousands of files from a web application. I will then put them into a zip send it by mail and delete them. I was thinking about storing them on the jboss server, but i'm not a big fan of this solution.
any idea of a cleaner solution?

If you send the files as an attachment, the files are stored on the mail server and there's no need to store them anywhere else. On the other hand, you might run into size limitations. If your files are too big to be directly attached to an email, you might consider storage services like AWS S3.

Related

Where to upload files in Tomcat?

I have a web application developed using Servlet and JSP, we will be hosting this in Daily Razor Privat Tomcat Hosting soon.
But, now we have a problem. We have a form where the users can upload files to the server, files like images and PDF's. Now, we are not sure in which place we should save these files in server. I have seen lot of Stackoverflow answers telling the user to use the path like "C:/Upload/.." but this is a real product, so this is not gonna work.
I contacted the hosting company about this matter and all they said is they will give the FTP logging details once I purchased the system, no word about where to upload the files.
I also thought about uploading to Amazon S3, but we have to create folders "dynamically" for each user and subfolders for their uploaded content, therefor I am not so sure about S3. Apart from that, I believe S3 will drain my wallet.
Any advice about the upload location in tomcat or an alternate will be really appreciated.
But, now we have a problem. We have a form where the users can upload files to the server, files like images and PDF's. Now, we are not sure in which place we should save these files in server.
If you're talking about long-term storage then there's no correct answer here. You'd just need to find a place on the server where your Tomcat user has permissions to write and configure the application to put them there.
I contacted the hosting company about this matter and all they said is they will give the FTP logging details once I purchased the system, no word about where to upload the files.
Once you have FTP details, you should be able to connect to the server and look at the file system. Presumably this would allow you to see the path where your application will be deployed. From there, it's just a matter of picking a location where you'd want to save the files.
I'm not familiar with that hosting provider, so I can't really same more.
I also thought about uploading to Amazon S3, but we have to create folders "dynamically" for each user and subfolders for their uploaded content, therefor I am not so sure about S3. Apart from that, I believe S3 will drain my wallet.
This can also be a good option, depending on your needs. Price is definitely something to evaluate. Demand and bandwidth on your hosting environment are others. If you have high demand on these resources, putting them on AWS will take the load of your server and not eat up the bandwidth allocation from your hosting provider.
You could also store your uploads in a database. I'm not personally a fan of this, but some people do it and I hear it works fine for them.

Java or PHP Applet to download groups of files from Amazon S3

I have a website that provides a photo service for clients. I want to use Amazon S3 as the storage space for all the photos but am having trouble interacting with the S3 buckets. What I need to do is give my customers access to all their photos sitting in their S3 bucket. I'd like to give them a visual display of all the images and then allow them to select a group or all of the photos for download. I'm assuming a Java applet is needed to handle this interaction. Does anyone know of a java based downloader that will interface with S3 or could possibly build one?
We've also thought of all or a group of files that reside on S3 but can't figure out how to zip files while they're on S3.
Any help is much appreciated!
I suppose when you mean by java based downloader you're talking about web services, sincerely I don't know much about Amazon S3 web services, but I do know they exist, and what I'd advise is to first get to know the Amazon web services, try to find if there is any web method to download the files (my bet is that it has to be a bit per bit download)
Concerning java applet you would only need it if you want to upload files, because of the existing security.

How do I handle a file upload from a mobile application on the server side?

I want to prototype a server component that accepts and handles file uploads from a mobile application (should not matter what platform the phone's running). The files in question are most likely just photos, so the file size should not be that big.
I'm looking for technology/tool/library recommendations or pointers. I'm not sure where to start. I haven't set up anything on the server-side yet so I'm not sure what I don't know. Something Java-related would definitely ease me into setting up the prototype quickly.
Thanks in advance.
You can use servlet on server-side to receive files, to generate unique names for these files and keep them preferable on file system (not on database). For example you can see
http://www.servletworld.com/servlet-tutorials/servlet-file-upload-example.html

HOW-TO: remote file access from a web server?

We have a web application which which is deployed and used within an intranet. The application reads in text files from a specified location on the web server itself.
Now we have a requirement of reading in text files from other machines as well, so i'm exploring possible options to implement this. Possible options i've been thinking of are:
Maybe start a ftp server on each local machine and then write a servlet to ftp given machines n read-in data.
Maybe run some utility program thats would read in file contents and push it back to the server using xml etc ?)
Ne help about above/or new ideas would be highly appreciated!
Technologies i'm using are :
Tomcat/Struts/JSP/AJAX.
P.S i want to handle non NFS situations as well!
Thanks,
Abhishek.
apart from the fact that I don't know whats the purpose of the application you're building, and knowing it is a Web-app, why not have users upload the specific files you want to process?, or even better, if they are configuration files, you might put them all in one single location, let's say just one machine. That might be better than having your app stuck just because some machine is not accessible.
I have an idea for you.... You may expose web service on each machine where from you want to get logs.These web services will read log files and send to your web application in bytes. You web application will call these service periodically and will take latest data. your entire system would work like a distributed system. you need to ensure that log file should generate with the name in uniform format - for eg.. log-24-12-2010.log or log24122010.log (if your log file generates on daily basis) - so that web services can form the right name of log and access it.
I recommand you to use RESTful web services because they are pretty easy for such purposes. Use JAX-RS APIs to develop such services.
I hope you would get my idea a little bit.
~~ Priyanjan

Large file uploads with Java applet

I've been tasked with implementing large (2gb+) file uploads via a web browser. After evaluating various technologies, java applets seem to be the way forward (only one's which provide proper access to the local disk). I was wondering if anyone can recommend a 3rd party file upload app we can use as a base? requirements are
Decent UI, ideally we want something similar to facebooks photo uploader
Can handle large (2gb+) files
Resumable uploads
We beed the source to extend it to our needs (dont mind paying extra)
You're probably looking for JUpload.
Update: not sure if it has as nice of UI as you're hoping, but unless you want to build a custom solution like I have it's your best option.
Just a tip, maybe it is obvious, i don't know :P
It is nice to send the big file in chunks like 2mb, and on the server side you just append the bytes to the target file. The server knows what bytes it needs, and if a upload is aborted and continued later, the server can just send a message about from what bytes to start uploading the file again. Then we get resumability (is it a word? :P) and safety of large HTTP-uploads (since, in fact, we are sending many smuller uploads, and each upload is checked to be of the correct size on the server).
We wrote an implementation like this once with a Java-applet as the client and PHP on the server, I'll see if I can dig it out as a reference for you :p
Not really a solution : from experience you may bump into the following issues:
problems when uploading over HTTPs
problems uploading through proxies
Just wanted to make you aware of these two cases, for you to test when evaluating a solution.
Hope, you will get solutions for your prob over here.. http://jupload.sourceforge.net/

Categories

Resources