Reply
Ive been challenged and am thinking i cant solve the problem.
Old 03-23-2008, 05:54 PM Ive been challenged and am thinking i cant solve the problem.
Novice Talker

Posts: 8
Name: Lance
Im a C++ developer that has been asked to create a WA that will allow the following to happen. First off, there are two frames on the page and a banner at the top. After the cgi based login, the new page on the remote server loads in a new browser window. the left frame, is the users local computer in their root design directory as specified by our application made in C++. The right frame is out server directory to upload the files. without paying for the code or helpful hints, how do we drag and drop files using only js and html from the local pc to the remote server and visa versa. The sooner I can do this, the less stress is put on my job.
LanceWassing is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 03-23-2008, 06:55 PM Re: Ive been challenged and am thinking i cant solve the problem.
tripy's Avatar
Fetchez la vache!

Posts: 1,857
Name: Thierry
Location: In the void
Is a WA a "web agent" ? Just a curiosity, nothing crucial here.

Simple answer: you cannot.

detailed answer: you have to understand that using only html and javascript, you cannot make any file upload.
HTML is a page description language, a bit like xml.

You have to use a server side language (php, jsp, asp.net or whatever other technology) to handle your file transfer.

What html let you do, is to encapsulate the binary data of 1 file into a POST request field. So, if you need to upload 2 files, you need 2 <input type="file"> with different names.

That in mind, you can create an FORM request with the files embedded in javascript by using DOM functions (it's pretty easy even), but then, you will need to add something on your server to put the files with the right names at the right place and to re-create the directory structure.

The easiest way: create an archive on the local computer, send it to the server and unpack the archive using a server side language.
The C++ way: create a secured deamon on your server, listening to a port, and stream the datas to your deamon from your c++ app
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 03-23-2008, 07:58 PM Re: Ive been challenged and am thinking i cant solve the problem.
Novice Talker

Posts: 8
Name: Lance
Thats the argument i had with my boss, and thought that... but now that its verified... i can tell my boss to flip. much appreciated, as my expertise is asm and c/c++ (old skool style) lol...

well thanks for the post
Lance Wassing
LanceWassing is offline
Reply With Quote
View Public Profile
 
Old 03-23-2008, 09:09 PM Re: Ive been challenged and am thinking i cant solve the problem.
tripy's Avatar
Fetchez la vache!

Posts: 1,857
Name: Thierry
Location: In the void
You're welcome.

And asm is not so old school. I used to do some when I was in formation.
Around, hmmm, 12 years ago...
Never got above C, though. But heard so many complaints from c++ devs that it did not gave me any curiosity to look by myself.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 03-24-2008, 01:31 PM Re: Ive been challenged and am thinking i cant solve the problem.
Novice Talker

Posts: 8
Name: Lance
c++ not so bad, however you need to remember your standard and addon libraries, there components, and uses etc. can get frusterating but if you know c, c++ isn't that far of jump for you.
LanceWassing is offline
Reply With Quote
View Public Profile
 
Old 03-26-2008, 04:35 PM Re: Ive been challenged and am thinking i cant solve the problem.
willcode4beer's Avatar
Webmaster Talker

Posts: 633
Name: Paul Davis
Location: San Francisco
This suggestion is pure evil but....

If one frame is open to the user's drive, and the other pointing to an FTP site (most browsers support the FTP protocol), then a user might be able to drag file between on and the other.
__________________
Paul Davis
willCode4Beer.com (coding for all the right reasons)
willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 03-26-2008, 04:45 PM Re: Ive been challenged and am thinking i cant solve the problem.
tripy's Avatar
Fetchez la vache!

Posts: 1,857
Name: Thierry
Location: In the void
Quote:
Originally Posted by willcode4beer View Post
This suggestion is pure evil but....

If one frame is open to the user's drive, and the other pointing to an FTP site (most browsers support the FTP protocol), then a user might be able to drag file between on and the other.
It's evil for open source advocate, I'd say.
I believe only IE support this. At least, firefox doesn't, and I don't know about opera nor safari
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 03-26-2008, 04:55 PM Re: Ive been challenged and am thinking i cant solve the problem.
VirtuosiMedia's Avatar
Webmaster Talker

Posts: 604
Quote:
Originally Posted by willcode4beer View Post
This suggestion is pure evil but....

If one frame is open to the user's drive, and the other pointing to an FTP site (most browsers support the FTP protocol), then a user might be able to drag file between on and the other.
So all he's asking about is a browser-based FTP? This might be a dumb question, but how can you detect the local computer using PHP? Or can you?
VirtuosiMedia is online now
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 03-26-2008, 05:09 PM Re: Ive been challenged and am thinking i cant solve the problem.
tripy's Avatar
Fetchez la vache!

Posts: 1,857
Name: Thierry
Location: In the void
Yes you can, but this is not an option, as it had to be done with HTML and javascript only.
If no server side languages are available, ftp is effectively the only solution I see .
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 03-26-2008, 05:39 PM Re: Ive been challenged and am thinking i cant solve the problem.
VirtuosiMedia's Avatar
Webmaster Talker

Posts: 604
Okay, never mind...I just found all the ftp functions in PHP that I didn't know about before.
VirtuosiMedia is online now
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Reply     « Reply to Ive been challenged and am thinking i cant solve the problem.
 

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16057 seconds with 13 queries