473,657 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JSP - uploading multiple files 'post' not working off server (works fine on localhost

6 New Member
I'm making a JSP page where (ideally) you select files to upload, each selected file is added to a listbox. The form is submit, (along with some other parameters), and the files are uploaded. They arent uploaded (written) tradionally to a server, I just need the file's input stream to pass to a method elsewhere (which will upload to a database).

The page has a file-input type to locate files to upload. Once a file is selected (onChange()), the filename is added to a listbox
Expand|Select|Wrap|Line Numbers
  1. <SELECT NAME="listfiles" MULTIPLE>
and there is a button which submits the form. The form submits to itself (so it will submit to the same jsp page)
Expand|Select|Wrap|Line Numbers
  1. <FORM NAME="formname" ACTION="uploadpage.jsp" METHOD="post" enctype="multipart/form-data">
On my local machine, I can open the page, select a file and submit -- the page loads fine. When on the web server, when I submit -- the page will go have an error -- the typical 'this page cannot be displayed' error which is shown a page's cant be found. I have absolutely no idea why! To me, it should simply load that page again. Some of the time it does this, and other times (most times) it just turns blank -- I can't work out why.

Similarly when I try to submit (on local machine) and just take the file-input value, eg with
Expand|Select|Wrap|Line Numbers
  1. MultipartRequest multi = new MultipartRequest(request, ".");
  2. params = multi.getFileNames();
and enumerate through and display the value of any files -- it shows the browse button's name but its value is always 'null' even though something was entered there. This won't be a problem if I don't need to get the filename through here to upload it as the other parameters (from the select box) come through fine with
Expand|Select|Wrap|Line Numbers
  1. Enumeration params = multi.getParameterNames();
where name="listfiles "

This is very frustrating and I really would appreciate help, particularly if I'm going about this the wrong way. Is it even possible to use filenames supplied in the listbox to get a local file's input stream or does it have to be a file-input type.

Thanks a lot
May 24 '07 #1
0 1686

Sign in to post your reply or Sign up for a free account.

Similar topics

10
2306
by: Tim Mulholland | last post by:
My company is about to begin working on an ASP.NET application. There are going to be two primary developers working on this project. It will be a fairly deep project (lots of lines of code) but not a very wide project (pretty much limited to a few purposes, not many ways to split it up). I've done alot of ASP.NET development before by myself so writing the application shouldn't be an issue, but my question is this: How do multiple...
13
4297
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
2
1431
by: tshad | last post by:
I have a page that I am using for multiple uses that includes reposting of the page as well as going to another page where the "form" tag would be something like: <form id="something" runat="server"> I looked at some of the upload examples and they all seem to have the uploading on a page by itself where the form is set to something like: <form Method="Post" EncType="Multipart/Form-Data" RunAt="Server">
2
3947
by: FusionGuy | last post by:
I've created a file uploading handler, implemented as an httpHandler. Each time I attempt to upload a file, or files, my HttpContext.Request.Files property never contains the files that were uploaded. Here's a snippet of my handler code: // *** BEGIN HANDLER CODE *** // public class AutoUpload : IHttpHandler { public void ProcessRequest(HttpContext context) {
4
1646
by: Ramakrishnan Nagarajan | last post by:
Hi, I am facing a different problem in my application. In that I am uploading a folder that contain only images. Everything was done and was working fine too. When I executed the application using the localhost it works fine. But when my machine acts as a client and executes the application from another machine (considered as the server) it is telling that the folder is not found, even if the folder is present in the client machine. The...
0
7265
by: Alex | last post by:
my app was working fine in VB.NET 2003 (and framework 1.1). Now with VB.NET 2005 (framework 2.0) the uploading to an http server (ie. www.sharebigfile.com) stops with the error "The request was aborted: The request was canceled" after about 7 MB. For example, I might be uploading a 73MB file. After about 11% done the upload aborts. :shake: It works great for files < 5MB. I can upload those every time.
2
1627
by: AAJ | last post by:
Hi all I have a few questions about file locations with VS2005, localhost WidowsXP and remotehost Server2003, and I wonder if anyone can help me get started 1) If I build a web site on my local server i.e. Creat WebSite from the opening menu, I can select my local webserver. Most of the files seem to be within InetPub\wwwroot\website\...
5
2717
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or more documents to share/use during a meeting presentation. What would be the most efficient way to approach this? This is the logic I'm currently considering: Page 1: Meeting Information input with link to a document upload page (this page...
1
2073
by: wenqiang7 | last post by:
I am encountering a very strang problem with file uploading in my ASP.Net page. When we try to upload certain file, we'll get an error msg of "Cannot find server or DNS Error". We are running on Win2003, IIS, ASP.Net 1.1. The page works fine if running from localhost. It only has problem when accessed from a domain name.
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.