473,406 Members | 2,707 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,406 software developers and data experts.

Uploading a directory instead of a file

I'd like to allow a user to point out a directory. There's facility for
pointing to a file, FileUpload, but there's nothing to get the path to a
given folder. How can that be solved (Silverlight is not an option).

Konrad Viltersten
Jun 27 '08 #1
8 939
I'd like to allow a user to point out a directory. There's facility for
pointing to a file, FileUpload, but there's nothing to get the path to a
given folder. How can that be solved (Silverlight is not an option).

Konrad Viltersten
In fact, as we're on the subject, when i get the information using
FileUploader.FileName
i only get the actual name and not the path. What i do need is the path,
acutally. The name itself is just an extra info. How can i get what i need?
--
Konrad Viltersten
Jun 27 '08 #2
Den 2008-05-07 09:23:40 skrev K Viltersten <tm**@viltersten.com>:
>I'd like to allow a user to point out a directory. There's facility for
pointing to a file, FileUpload, but there's nothing to get the path to
a given folder. How can that be solved (Silverlight is not an option).

Konrad Viltersten

In fact, as we're on the subject, when i get the information using
FileUploader.FileName
i only get the actual name and not the path. What i do need is the path,
acutally. The name itself is just an extra info. How can i get what i
need?
As i read my post i realize that someone will soon give me the (indeed
correct) information to use PostedFile.FileName. Is this the correct way
of obtaining the full path? Since no file has been uploaded on my system
(only a path has been obtained), i feel a future issues arise. Is it a
recommended way?

P.S.
Sorry for the scattered posting. Too much/little coffee, i say. :)

Konrad Viltersten

Jun 27 '08 #3
Unfortunately, the path isn't going to do you any good at all. All you can
get is a file, not a directory. The upload control can only upload a single
file at a time because that's what the RFC for handling file upload on the
web specify. You can't access the filepath that exists on the user's machine
so that won't help since all you have access to is the file they select, and
some information about it.

To get around this would take an aweful lot of work as you would have to do
something drastic such as resort to WPF, a winform embedded in the browser,
or a custom browser add-in. None of these are really good solutions though
as they would be difficult and expensive to implement, not to mention would
probably annoy users if they had to do things such as download the .net
framework to run a winform.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression

"K Viltersten" <tm**@viltersten.comwrote in message
news:op***************@lp028.pagero.local...
Den 2008-05-07 09:23:40 skrev K Viltersten <tm**@viltersten.com>:
>>I'd like to allow a user to point out a directory. There's facility for
pointing to a file, FileUpload, but there's nothing to get the path to
a given folder. How can that be solved (Silverlight is not an option).

Konrad Viltersten

In fact, as we're on the subject, when i get the information using
FileUploader.FileName
i only get the actual name and not the path. What i do need is the path,
acutally. The name itself is just an extra info. How can i get what i
need?

As i read my post i realize that someone will soon give me the (indeed
correct) information to use PostedFile.FileName. Is this the correct way
of obtaining the full path? Since no file has been uploaded on my system
(only a path has been obtained), i feel a future issues arise. Is it a
recommended way?

P.S.
Sorry for the scattered posting. Too much/little coffee, i say. :)

Konrad Viltersten
Jun 27 '08 #4
Unfortunately, the path isn't going to do you any good at all. All you
can get is a file, not a directory. The upload control can only upload a
single file at a time because that's what the RFC for handling file
upload on the web specify. You can't access the filepath that exists on
the user's machine so that won't help since all you have access to is
the file they select, and some information about it.

To get around this would take an aweful lot of work as you would have to
do something drastic such as resort to WPF, a winform embedded in the
browser, or a custom browser add-in. None of these are really good
solutions though as they would be difficult and expensive to implement,
not to mention would probably annoy users if they had to do things such
as download the .net framework to run a winform.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression
It didn't help but at least i know where i'm standing, hehe.

Thanks!

Konrad Viltersten
Jun 27 '08 #5
"K Viltersten" <tm**@viltersten.comwrote in message
news:op***************@lp028.pagero.local...
I'd like to allow a user to point out a directory. There's facility for
pointing to a file, FileUpload, but there's nothing to get the path to a
given folder.
You can't do this natively.
How can that be solved
Very simply: http://www.utechsoft.com/products/uupload/
(Silverlight is not an option).
Why not...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #6
>I'd like to allow a user to point out a directory. There's facility for
>pointing to a file, FileUpload, but there's nothing to get the path to
a given folder.

You can't do this natively.
Bad news. Thanks anyway!
>How can that be solved

Very simply: http://www.utechsoft.com/products/uupload/
>(Silverlight is not an option).

Why not...?
Project specification. The solution must not require any additional
installations and this far, sadly, if i may say so, Silverlight is not as
spread as to be regarded a standard. Even sadlier, i can not use the
UTechSoft solution either, as the requirement is to code the project using
MS products solely. Nevertheless, good info. Thanks!

Konrad Viltersten
Jun 27 '08 #7
"K Viltersten" <tm**@viltersten.comwrote in message
news:op***************@lp028.pagero.local...
as the requirement is to code the project using MS products solely
That is really short-sighted, IMO...

Whenever I've been faced with a similar situation in the past, my usual
response is "No problem - it will probably take me several months to develop
what you want, at my standard daily rate. Alternatively, you can have it
this afternoon for a few hundred dollars..."
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #8
On May 7, 2:45*am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"K Viltersten" <t...@viltersten.comwrote in message

news:op***************@lp028.pagero.local...
as the requirement is to code the project using MS products solely

That is really short-sighted, IMO...

Whenever I've been faced with a similar situation in the past, my usual
response is "No problem - it will probably take me several months to develop
what you want, at my standard daily rate. Alternatively, you can have it
this afternoon for a few hundred dollars..."

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
I strongly agree with Mark on this one. Perhaps you should go back to
your customer and figure out what they really want, not what they
THINK they want...big difference...I've seen customers that
mandate .NET, or SOA, when all they really needed was a simple
javascript solution - they just thought they wanted the latest and
greatest buzzwords.

Good luck!
Shane
Jun 27 '08 #9

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

Similar topics

4
by: dickiedyce | last post by:
Hi there. I've spent the weekend getting ever more frustrated, trying to get an upload file function working on a website. The site is hosted by a company called oneandone. They're using PHP...
9
by: R. Rajesh Jeba Anbiah | last post by:
Q: How should I handle file upload? A: File uploading requires HTML form of content type "multipart/form-data". The file content has to be POSTed/submitted via the form and once the file is...
1
by: Jason Gleason | last post by:
I'm trying to set up an http upload program that has almost identical code to the following page: ...
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: VB Programmer | last post by:
I know how to upload an individual file to a server (See below code snippet). QUESTION: Is there an easy way to upload an entire subdirectory and all it's files? Or, do I have to loop thru the...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
4
by: Mukesh | last post by:
Hi all I am trying to upload and save as a picture to "root/Photos" folder in my web application. I am using this code to perform this task DirectoryInfo strFolder = new...
1
by: ali | last post by:
I am writing a script which uploads file to a specific directory; I am using javascript to handle client side exceptions and php script which actually performs file uploading. Php scripts gets...
11
by: salmobytes | last post by:
Perhaps this is an apache server question, rather than a php question. But I want to use a simple php upload script in a user-home-sub-document-root dir on a standard linux box. If php is a...
8
by: K Viltersten | last post by:
If i go as follows: <asp:FileUpload ID="dirTemp" runat="server" Width="400px" /><br /> The element i create is requiring me to select a file. Can i use this control to point out a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...

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.