upload_dir via http://localhost

Hi,

I'd to upload a file to a folder :

$upload_dir = "MyFolder/";

if (isset($_POST['action'])) {
if (!is_dir("$upload_dir"))
{ die ("The directory doesn't exist"); ....

it's ok when I use it!

Now, my windows XP Sp2 has a web server IIS

$upload_dir = "http://localhost/MyFolder/";

and it gives the error : The directory doesn't exist

"MyFolder/" is always in C:\Inetpub\wwwroot
ie C:\Inetpub\wwwroot\MyFolder

Thank you for showing me how to use
"myFolder" via http://localhost
Jimmy [ Di, 15 Januar 2008 22:33 ] [ ID #1908610 ]

Re: upload_dir via http://localhost

Jimmy wrote:
> Hi,
>
> I'd to upload a file to a folder :
>
> $upload_dir = "MyFolder/";
>
> if (isset($_POST['action'])) {
> if (!is_dir("$upload_dir"))
> { die ("The directory doesn't exist"); ....
>
> it's ok when I use it!
>
> Now, my windows XP Sp2 has a web server IIS
>
> $upload_dir = "http://localhost/MyFolder/";
>
> and it gives the error : The directory doesn't exist
>
> "MyFolder/" is always in C:\Inetpub\wwwroot
> ie C:\Inetpub\wwwroot\MyFolder
>
> Thank you for showing me how to use
> "myFolder" via http://localhost

http://localhost/MyFolder/ isn't a (local) directory, it's a URL.

Since you have an invocation that works, why do you want to do something
diferent?
Paul Lautman [ Di, 15 Januar 2008 22:40 ] [ ID #1908612 ]

Re: upload_dir via http://localhost

"Paul Lautman" <paul.lautman [at] btinternet.com> wrote in message
news:5v4nhnF1l3ttvU1 [at] mid.individual.net...
>>
>> $upload_dir = "MyFolder/";
>>
>> if (isset($_POST['action'])) {
>> if (!is_dir("$upload_dir"))
>> { die ("The directory doesn't exist"); ....
>>
>> it's ok when I use it!
>>
>> Now, my windows XP Sp2 has a web server IIS
>>
>> $upload_dir = "http://localhost/MyFolder/";
>>
>> and it gives the error : The directory doesn't exist
>>
>> "MyFolder/" is always in C:\Inetpub\wwwroot
>> ie C:\Inetpub\wwwroot\MyFolder
>>
>> Thank you for showing me how to use
>> "myFolder" via http://localhost
>
> http://localhost/MyFolder/ isn't a (local) directory, it's a URL.
>
> Since you have an invocation that works, why do you want to do something
> diferent?
Thank you for your help,

then how can I use the URL instead of the folder ?

Any help would be appreciated
Jimmy [ Mi, 16 Januar 2008 07:31 ] [ ID #1909678 ]

Re: upload_dir via http://localhost

Jimmy wrote:
> "Paul Lautman" <paul.lautman [at] btinternet.com> wrote in message
> news:5v4nhnF1l3ttvU1 [at] mid.individual.net...
>>> $upload_dir = "MyFolder/";
>>>
>>> if (isset($_POST['action'])) {
>>> if (!is_dir("$upload_dir"))
>>> { die ("The directory doesn't exist"); ....
>>>
>>> it's ok when I use it!
>>>
>>> Now, my windows XP Sp2 has a web server IIS
>>>
>>> $upload_dir = "http://localhost/MyFolder/";
>>>
>>> and it gives the error : The directory doesn't exist
>>>
>>> "MyFolder/" is always in C:\Inetpub\wwwroot
>>> ie C:\Inetpub\wwwroot\MyFolder
>>>
>>> Thank you for showing me how to use
>>> "myFolder" via http://localhost
>> http://localhost/MyFolder/ isn't a (local) directory, it's a URL.
>>
>> Since you have an invocation that works, why do you want to do something
>> diferent?
> Thank you for your help,
>
> then how can I use the URL instead of the folder ?
>
> Any help would be appreciated
>
>
>

You can't. Like it's name indicates - is_dir() checks to see if the
parameter is a directory.

And like Paul asked. Why are you changing something that's working?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex [at] attglobal.net
==================
Jerry Stuckle [ Mi, 16 Januar 2008 13:09 ] [ ID #1909698 ]
PHP » comp.lang.php » upload_dir via http://localhost

Vorheriges Thema: PHP fails writing to text file?
Nächstes Thema: HTTP POST from PHP using a link