473,408 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Uploading Files Using Javascript: Can't Access File Collection On Server

Hi.

I am having a really tough time here and would appreciate some help.

i am using an iFrame to pass a url string of files to upload to server.

on the client i have created a multiple upload javascript using the
below link:

http://the-stickman.com/web-developm...-file-element/

and a way of constructing an iFrame and passing the file upload params
to the server using this link:

http://developer.apple.com/internet/...nt/iframe.html

and, then, server code for processing the uploaded files using the
below code:
Dim myfiles As System.Web.HttpFileCollection =
System.Web.HttpContext.Current.Request.Files
Dim iFile As Integer

For iFile = 0 To myfiles.Count - 1
' get the posted file
Dim postedFile As System.Web.HttpPostedFile =
myfiles(iFile)
Dim fileSize As Integer = postedFile.ContentLength

Dim files As New ArrayList
'make sure it is not blank
If Not postedFile.FileName.Equals("") Then
files.Add(System.IO.Path.GetFileName(postedFile.Fi leName))

'Save File to the proper directory
'postedFile.SaveAs(Request.MapPath("folder/") +
System.IO.Path.GetFileName(postedFile.FileName))

End If

Next iFile

so:

1. files are uploaded via javascript
2. files are passed through a dynamically created iframe to the server
3. the server code is executed
4. a response on the client is executed using:
window.parent.handleResponse();
but, when i try to catch the httpfilecollection for processing, i
always get length=0 and, hence,
count=0.

my guesses/questions:

1. i have set form enctype=multipart/form-data on client.aspx, but not
on server.aspx because

server.aspx is really just 2 scripts. should the server have form tags
also?

2. according to the user, he always sees client.aspx and never sees
server.aspx. but, the

file params are sent via iframe to server.aspx for back-end processing.
is it possible that the

httpfilecollection is looking at the client.aspx url string, and not
the server.aspx url string?

i have posted this all over the internet and nobody touches this
question. please tell me where

i am being confusing (or what code you would like to see) rather than
not respond.

thank you.

peter

Dec 15 '06 #1
0 1596

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Asha | last post by:
greetings, i need to upload an .xls file using a secure connection. so i though of using https... can i know how this can be done?
13
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...
4
by: Mark Miller | last post by:
I've been trying to execute a javascript function just before submit on a form that contains an <input type="file"> input field and it isn't working. The reason I want to do this is the end users...
3
by: Dean Richardson | last post by:
Hi, I'm having trouble uploading files via a PHP script. Whenever I upload a file greater than 10K, the file gets corrupted. However, text files upload OK. When I check the FTP Server log I...
9
by: C.Joseph Drayton | last post by:
Hi All, I have a web site I am developing, and have a question. I would like members to be able to upload pictures. Do you think they should be saved as individual files or should they be put...
2
by: Kausar | last post by:
Hello All, I want to know how to scan the files before uploading it to the server in ASP.NET 2.0 application. One work arround i thought is to allow to upload in some temporary folder then sacn...
0
by: Moskie | last post by:
I have a form where the user is able to provide an arbitrary number of attachments. This is done through Javascript that dynamically generates INPUT fields, each of which has the NAME attribute set...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
by: LoriFranklin | last post by:
I'm a bit of a newbie here. I've learned a lot from reading the posts you all have here. I need some help uploading files using an asp form. I am using some code that I found from Jacob at...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.