Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2009, 08:11 PM
yssirhc yssirhc is offline
Junior Member
 
Join Date: Mar 2009
Posts: 7
Default passing html file inputs to delphi script for uploading

So I have a web app that lets you upload files to its server. Currently it allows you to upload one file at a time. Now I'm trying to make it so that it can upload as many files as you want at the same time. It does this by dynamically adding/removing file textboxes. I've tried numerous things with my javascript & html code to make this happen but always end up finding something wrong with it, so I thought I'd try to make changes with the server's delphi script instead.

The problem I'm having is getting all the correct files transferred from the html form to the delphi code. Currently, to upload one file, the code is:
[delphi]
upname := formvar('file_filename', '');
filename := extractfilename(formvar('file', ''));
[/delphi]

The first parameter being the name of the form element and the second parameter being the value of the form element. The problem with this though is that since the user can dynamically add & remove file textboxes, there could be some with the SAME name, so I end up uploading those twice & others not at all.

Is there an easy way to get all those files that are submitted in the form to the delphi script so that I can just loop through the rest of the file upload process?
Reply With Quote
  #2  
Old 03-23-2009, 09:23 PM
develyoy develyoy is offline
Senior Member
 
Join Date: Nov 2007
Posts: 628
Default RE: passing html file inputs to delphi script for uploading

I would try to give unique name's to the file-fields, like "file1", "file2" etc...

(By the way: what technology are you using server-side?)
Reply With Quote
  #3  
Old 03-24-2009, 06:17 PM
yssirhc yssirhc is offline
Junior Member
 
Join Date: Mar 2009
Posts: 7
Default RE: passing html file inputs to delphi script for uploading

well, that's what I was originally doing with my javascript, but then I was having problems figuring out where the file that needed to be deleted was located in the array when the user clicked "Remove".

It's Windows 2000 Server SP4 - IIS 5, Delphi 7.
Reply With Quote
  #4  
Old 03-25-2009, 10:49 AM
develyoy develyoy is offline
Senior Member
 
Join Date: Nov 2007
Posts: 628
Default RE: passing html file inputs to delphi script for uploading

I started a project to solve issues like this one: http://xxm.sourceforge.net/
It's based on IIS and Delphi7 as well.
It has an IInternetProtocol dll also, which allows you to develop with InternetExplorer, and put the final library live. It auto-compiles if you refresh in IE and it notices files have changed.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 04:34 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.