List Info

Thread: Multiple File Upload Using Javascript: Can't Access File Collection On Server




Multiple File Upload Using Javascript: Can't Access File Collection On Server
user name
2006-12-15 17:09:11
Hi.

I have posted this question in .NET forums but am surprised
that nobody
responds.
Since this question really relatetes to use of the
document.location
string and how
it is accessed, i hope that some javascript person with
equal knowledge
of ASP.NET
forms could help.

in this problem, i am using an iFrame to pass a url string
of video
files to upload to the server. on the client i have created
a script
for uploading multiple video files using the
below link:

http://the-stickman.com/web-development/
javascript/upload-multiple-fi...

the script(s) for dynamically creating the iFrame for upload
is here:
http://developer.apple.com/internet/webcontent/iframe.
html

finally, the server code for processing the uploaded files
is here:
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.FileName))

                    '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


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "JavaScript Forum" group.
To post to this group, send email to
JavaScript-Informationgooglegroups.com
To unsubscribe from this group, send email to
JavaScript-Information-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/JavaScript-I
nformation?hl=en
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )