Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 29th, 2005, 8:07 PM   #1
bennyz12
Newbie
 
Join Date: Jul 2005
Posts: 2
Rep Power: 0 bennyz12 is on a distinguished road
Upload file without using <INPUT TYPE="FILE">

Is that any solution to upload a file without using the Input type="file" ?
The browser I need to handle now cannot support pop up window. So I cannot use the FILE type since it need to browse the file with the pop up window. Can I know any other way to upload the file? Thank you
bennyz12 is offline   Reply With Quote
Old Jul 29th, 2005, 8:46 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Cross posting contravenes the forum rules. Please read them.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 31st, 2005, 8:32 PM   #3
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Try this

Try making something like a hyperlink

<a href="name of file if in the same folder"> Name of Link </a>

If you dont have the file in the same folder than you should try something like this

<a href="c:/foldername/filename.whatever"> Name of Link </a>

Sorry if i am completely of target but i hope that helps.

Last edited by crawforddavid2006; Jul 31st, 2005 at 8:33 PM. Reason: needed to add on
crawforddavid2006 is offline   Reply With Quote
Old Aug 3rd, 2005, 11:15 PM   #4
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Well first of all, I don't know why a browser that blocks pop-ups would block a Browse... dialog -- that's interaction with the OS's API, not HTML.

Furthermore, if you need to upload a file, you can use one of those type="file" boxes and just type in the name, like
C:\myfile.ext

That's all browsing for the file would do, anyways.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old Aug 31st, 2005, 7:53 AM   #5
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4 mackenga is on a distinguished road
Using a link to a file on the user's local filesystem; like:

<A href="C:\foo.txt">

won't work for obvious privacy/security reasons. What happens instead is that the user, on following the link, sees that local file rendered in their browser (assuming their browser, like most, can open local files this way). This can be disorientating for users, since they get the impression that file has somehow gone to your website (particularly if you use a frameset) but it's just a prank and has no useful applications that I know of, really; the file stays on their machine.

There isn't really a way to upload a file without using <INPUT type="file">, since that's the only way you can get the browser to send a file and the server to receive one. (Make sure you set the form's encoding to "multipart/form-data" when using this feature, by the way; probably won't solve your problem but it's inefficient to do otherwise and who knows, some browsers might make defective upload fields if the form's encoding is the default ("application/x-www-form-urlencoded" I think)).

One way to get a signficant amount of essentially textual data from the user's machine to the server would be to have the user paste it into a TEXTAREA and POST it. That's the only other idea I can think of - failing something elaborate like a Java applet (which would have to be trusted to access the user's filesystem anyway).

Hope this helps.
mackenga is offline   Reply With Quote
Old Aug 31st, 2005, 8:39 AM   #6
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
PHP makes this simple.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Aug 31st, 2005, 11:20 AM   #7
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Quote:
Originally Posted by bennyz12
Is that any solution to upload a file without using the Input type="file" ?
The browser I need to handle now cannot support pop up window. So I cannot use the FILE type since it need to browse the file with the pop up window. Can I know any other way to upload the file? Thank you
What browser is that? The file select window isn't a popup window, but an integral part of the browser or OS. You're not still using Mosaic, are ya? :p
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Aug 31st, 2005, 2:27 PM   #8
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Quote:
Originally Posted by iignotus
Well first of all, I don't know why a browser that blocks pop-ups would block a Browse... dialog -- that's interaction with the OS's API, not HTML.
Quote:
Originally Posted by Ooble
What browser is that? The file select window isn't a popup window, but an integral part of the browser or OS. You're not still using Mosaic, are ya?
Is there an echo in here?
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old Aug 31st, 2005, 3:59 PM   #9
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Shush you. :p

I'm tired. That's my excuse.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:06 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC