Cannot overwrite file using IIS FTP v6.0?

This is a discussion on Cannot overwrite file using IIS FTP v6.0? within the Inetserver forums in Microsoft Tools category; Hi there, I have an application that is able to upload a .gif image file with the same name into a folder every minute. I have setup the FTP Service from IIS6.0 under Server 2003 The application finds the folder with no problem & uploads the file. However it will not overwrite the 'gif file preferring instead to name the file by date and with a .tmp file extension which increases by 60 every hour! If I rename the .tmp to .gif then it displays as one would expect a .gif file to display so it is not a .tmp ...

Go Back   Application Development Forum > Microsoft Tools > Inetserver

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-02-2008, 09:17 PM
Pheasant PluckerŪ
Guest
 
Default Cannot overwrite file using IIS FTP v6.0?

Hi there,

I have an application that is able to upload a .gif image file with the same
name into a folder every minute.

I have setup the FTP Service from IIS6.0 under Server 2003

The application finds the folder with no problem & uploads the file.

However it will not overwrite the 'gif file preferring instead to name the
file by date and with a .tmp file extension which increases by 60 every
hour!

If I rename the .tmp to .gif then it displays as one would expect a .gif
file to display so it is not a .tmp file in the best sense of the word...

So my question is;

Does the IIS FTP Service allow a file to be overwritten?

I am guessing the application uses what would be the standard 'Put'
command...

If it doesn't allow an overwrite is there a work-round? For example a
command line switch or alternative to the 'Put' command that will force an
overwrite?

Am I even correct about the inability of the FTP Service from IIS 6.0 to
allow an overwrite of an existing file with another file that has the same
name and if so is there a document from Microsoft that documents this
behaviour?

Thanks & regards,
-=pp=-


--
Thanks & regards,
-=pp=-


Reply With Quote
  #2  
Old 09-03-2008, 03:35 AM
Bernard Cheah [MVP]
Guest
 
Default Re: Cannot overwrite file using IIS FTP v6.0?

Yes, overwrite is allowed. what is the error msgs when you try to overwrite
the file?
access denied ? it could be relate to IIS caching.
The old KB has been taken down, in the past I have seen this before
http://support.qualtrax.com/replicat...h/00024032.HTM

immediate overwrite will cause the error. yet it is not recommended to
disable caching as the parameter affect entire IIS and not just FTP.

--
Regards,
Bernard Cheah
http://www.iis.net/
http://msmvps.com/blogs/bernard/


"Pheasant Plucker" <pheasant@plucker.not> wrote in message
news:%23A4IdLWDJHA.340@TK2MSFTNGP03.phx.gbl...
> Hi there,
>
> I have an application that is able to upload a .gif image file with the
> same name into a folder every minute.
>
> I have setup the FTP Service from IIS6.0 under Server 2003
>
> The application finds the folder with no problem & uploads the file.
>
> However it will not overwrite the 'gif file preferring instead to name the
> file by date and with a .tmp file extension which increases by 60 every
> hour!
>
> If I rename the .tmp to .gif then it displays as one would expect a .gif
> file to display so it is not a .tmp file in the best sense of the word...
>
> So my question is;
>
> Does the IIS FTP Service allow a file to be overwritten?
>
> I am guessing the application uses what would be the standard 'Put'
> command...
>
> If it doesn't allow an overwrite is there a work-round? For example a
> command line switch or alternative to the 'Put' command that will force an
> overwrite?
>
> Am I even correct about the inability of the FTP Service from IIS 6.0 to
> allow an overwrite of an existing file with another file that has the same
> name and if so is there a document from Microsoft that documents this
> behaviour?
>
> Thanks & regards,
> -=pp=-
>
>
> --
> Thanks & regards,
> -=pp=-
>



Reply With Quote
  #3  
Old 09-03-2008, 11:07 AM
Alun Jones
Guest
 
Default Re: Cannot overwrite file using IIS FTP v6.0?

"Pheasant PluckerŪ" <pheasant@plucker.not> wrote in message
news:#A4IdLWDJHA.340@TK2MSFTNGP03.phx.gbl...
> I have an application that is able to upload a .gif image file with the
> same name into a folder every minute.
>
> I have setup the FTP Service from IIS6.0 under Server 2003
>
> The application finds the folder with no problem & uploads the file.
>
> However it will not overwrite the 'gif file preferring instead to name the
> file by date and with a .tmp file extension which increases by 60 every
> hour!


That sounds like the FTP server is creating a unique file name each time the
upload is attempted.

A compliant FTP server will do that in only one case - and that's when the
client application is using the "STOU" (STOre Unique) command. You can
verify this by checking the log to see which commands are being received at
the server, and/or by monitoring the network traffic using Network Monitor.

If your application used the "STOR" command, you would find that IIS would
fail to write the file if it could not overwrite it. In fact you can verify
this from most FTP clients. Uploading, then re-uploading, a file will result
in it being overwritten with new contents. Most FTP clients (other than the
command-line FTP client in Windows) also allow you to specify that uploads
should be uniquely named, so that the STOU command is used, in which case
you can replicate this behaviour.

> If I rename the .tmp to .gif then it displays as one would expect a .gif
> file to display so it is not a .tmp file in the best sense of the word...


What _are_ the normal contents of a ".tmp file in the best sense of the
word"?

> I am guessing the application uses what would be the standard 'Put'
> command...


Watch where you swing those assumptions!

> If it doesn't allow an overwrite is there a work-round? For example a
> command line switch or alternative to the 'Put' command that will force an
> overwrite?
>
> Am I even correct about the inability of the FTP Service from IIS 6.0 to
> allow an overwrite of an existing file with another file that has the same
> name and if so is there a document from Microsoft that documents this
> behaviour?


No - overwriting files is a normal behaviour for most FTP servers. Renaming
an uploaded file is a rare, but well-described feature of the FTP protocol
when using the STOU command to initiate the upload. When faced with the
choice between two possibilities - that a normal behaviour has been broken,
or that a rare but documented activity is occurring, I generally start with
checking if the documented activity is what's happening.

STOU is used so rarely that I don't think you should feel upset about not
knowing about it.

Alun.
~~~~
--
Texas Imperial Software | Web: http://www.wftpd.com/
23921 57th Ave SE | Blog: http://msmvps.com/alunj/
Woodinville WA 98072-8661 | WFTPD, WFTPD Pro are Windows FTP servers.
Fax/Voice +1(425)807-1787 | Try our NEW client software, WFTPD Explorer.


Reply With Quote
  #4  
Old 09-03-2008, 05:19 PM
Pheasant PluckerŪ
Guest
 
Default Re: Cannot overwrite file using IIS FTP v6.0?

Thanks for the reply Bernard,

To be honest I never saw an error message in the program that uploads the
file to the server and never looked for a log in IIS

I ran the program in /DEBUG mode and used DBWin32 to capture the output and
I did see the following;

12:58:22: + Timer_AutoFTPTimer

12:58:24: Timer_AutoFTPTimer - error: RadarBoxScreenShot.gif: Cannot create
a file when that file already exists.

All moot now as I have uninstalled the FTP Service and have installed Serv-U
which allows the application to upload without any problems and which is a
much better choice for me.

Thanks & regards,
-=pp=-



"Bernard Cheah [MVP]" <qbernard@hotmail.com.discuss> wrote in message
news:uS7AheZDJHA.5060@TK2MSFTNGP03.phx.gbl...
> Yes, overwrite is allowed. what is the error msgs when you try to
> overwrite the file?
> access denied ? it could be relate to IIS caching.
> The old KB has been taken down, in the past I have seen this before
> http://support.qualtrax.com/replicat...h/00024032.HTM
>
> immediate overwrite will cause the error. yet it is not recommended to
> disable caching as the parameter affect entire IIS and not just FTP.
>
> --
> Regards,
> Bernard Cheah
> http://www.iis.net/
> http://msmvps.com/blogs/bernard/
>
>
> "Pheasant Plucker" <pheasant@plucker.not> wrote in message
> news:%23A4IdLWDJHA.340@TK2MSFTNGP03.phx.gbl...
>> Hi there,
>>
>> I have an application that is able to upload a .gif image file with the
>> same name into a folder every minute.
>>
>> I have setup the FTP Service from IIS6.0 under Server 2003
>>
>> The application finds the folder with no problem & uploads the file.
>>
>> However it will not overwrite the 'gif file preferring instead to name
>> the file by date and with a .tmp file extension which increases by 60
>> every hour!
>>
>> If I rename the .tmp to .gif then it displays as one would expect a .gif
>> file to display so it is not a .tmp file in the best sense of the word...
>>
>> So my question is;
>>
>> Does the IIS FTP Service allow a file to be overwritten?
>>
>> I am guessing the application uses what would be the standard 'Put'
>> command...
>>
>> If it doesn't allow an overwrite is there a work-round? For example a
>> command line switch or alternative to the 'Put' command that will force
>> an overwrite?
>>
>> Am I even correct about the inability of the FTP Service from IIS 6.0 to
>> allow an overwrite of an existing file with another file that has the
>> same name and if so is there a document from Microsoft that documents
>> this behaviour?
>>
>> Thanks & regards,
>> -=pp=-
>>
>>
>> --
>> Thanks & regards,
>> -=pp=-
>>

>
>



Reply With Quote
  #5  
Old 09-03-2008, 05:28 PM
Pheasant PluckerŪ
Guest
 
Default Re: Cannot overwrite file using IIS FTP v6.0?

Thanks for the reply Alun,

Not sure what/how the application uses to upload the file all I do know is
it uploads a screenshot from itself once every 60 seconds.

The very first file is called RadarBoxScreenShot.gif and the idea is it gets
overwritten once every 60 seconds to keep an updated screenshot in position.

Every subsequent file after that is named after the date/time it was
captured/uploaded;

_200808311954.tmp
_200808311955.tmp
_200808311956.tmp
etc.

The .tmp file is actually the .gif screenshot because if I rename the file
extension to .gif it displays in any image viewer.

I never checked the logs at the server but did see the following output in
the applications /DEBUG mode with the output captured by DBWin32;

12:58:22: + Timer_AutoFTPTimer

12:58:24: Timer_AutoFTPTimer - error: RadarBoxScreenShot.gif: Cannot create
a file when that file already exists.

Not much help I guess but all moot now as I have removed the FTP Service
from IIS and installed Serv-U which handles the uploads as it should and is
much better for me to use.

I don't feel so upset now that it's working! ;^)

Kind regards,
-=pp=-


"Alun Jones" <alun@texis.invalid> wrote in message
news:eM6LKTdDJHA.5060@TK2MSFTNGP03.phx.gbl...
> "Pheasant PluckerŪ" <pheasant@plucker.not> wrote in message
> news:#A4IdLWDJHA.340@TK2MSFTNGP03.phx.gbl...
>> I have an application that is able to upload a .gif image file with the
>> same name into a folder every minute.
>>
>> I have setup the FTP Service from IIS6.0 under Server 2003
>>
>> The application finds the folder with no problem & uploads the file.
>>
>> However it will not overwrite the 'gif file preferring instead to name
>> the file by date and with a .tmp file extension which increases by 60
>> every hour!

>
> That sounds like the FTP server is creating a unique file name each time
> the upload is attempted.
>
> A compliant FTP server will do that in only one case - and that's when the
> client application is using the "STOU" (STOre Unique) command. You can
> verify this by checking the log to see which commands are being received
> at the server, and/or by monitoring the network traffic using Network
> Monitor.
>
> If your application used the "STOR" command, you would find that IIS would
> fail to write the file if it could not overwrite it. In fact you can
> verify this from most FTP clients. Uploading, then re-uploading, a file
> will result in it being overwritten with new contents. Most FTP clients
> (other than the command-line FTP client in Windows) also allow you to
> specify that uploads should be uniquely named, so that the STOU command is
> used, in which case you can replicate this behaviour.
>
>> If I rename the .tmp to .gif then it displays as one would expect a .gif
>> file to display so it is not a .tmp file in the best sense of the word...

>
> What _are_ the normal contents of a ".tmp file in the best sense of the
> word"?
>
>> I am guessing the application uses what would be the standard 'Put'
>> command...

>
> Watch where you swing those assumptions!
>
>> If it doesn't allow an overwrite is there a work-round? For example a
>> command line switch or alternative to the 'Put' command that will force
>> an overwrite?
>>
>> Am I even correct about the inability of the FTP Service from IIS 6.0 to
>> allow an overwrite of an existing file with another file that has the
>> same name and if so is there a document from Microsoft that documents
>> this behaviour?

>
> No - overwriting files is a normal behaviour for most FTP servers.
> Renaming an uploaded file is a rare, but well-described feature of the FTP
> protocol when using the STOU command to initiate the upload. When faced
> with the choice between two possibilities - that a normal behaviour has
> been broken, or that a rare but documented activity is occurring, I
> generally start with checking if the documented activity is what's
> happening.
>
> STOU is used so rarely that I don't think you should feel upset about not
> knowing about it.
>
> Alun.
> ~~~~
> --
> Texas Imperial Software | Web: http://www.wftpd.com/
> 23921 57th Ave SE | Blog: http://msmvps.com/alunj/
> Woodinville WA 98072-8661 | WFTPD, WFTPD Pro are Windows FTP servers.
> Fax/Voice +1(425)807-1787 | Try our NEW client software, WFTPD Explorer.
>
>



Reply With Quote
  #6  
Old 09-11-2008, 02:56 AM
Bernard Cheah [MVP]
Guest
 
Default Re: Cannot overwrite file using IIS FTP v6.0?

Oops. sorry, been busy. what about IIS ftp log?

--
Regards,
Bernard Cheah
http://www.iis.net/
http://msmvps.com/blogs/bernard/


<Pheasant Plucker? <pheasant@plucker.not>> wrote in message
news:O7UHrwgDJHA.3396@TK2MSFTNGP03.phx.gbl...
> Thanks for the reply Bernard,
>
> To be honest I never saw an error message in the program that uploads the
> file to the server and never looked for a log in IIS
>
> I ran the program in /DEBUG mode and used DBWin32 to capture the output
> and I did see the following;
>
> 12:58:22: + Timer_AutoFTPTimer
>
> 12:58:24: Timer_AutoFTPTimer - error: RadarBoxScreenShot.gif: Cannot
> create a file when that file already exists.
>
> All moot now as I have uninstalled the FTP Service and have installed
> Serv-U which allows the application to upload without any problems and
> which is a much better choice for me.
>
> Thanks & regards,
> -=pp=-
>
>
>
> "Bernard Cheah [MVP]" <qbernard@hotmail.com.discuss> wrote in message
> news:uS7AheZDJHA.5060@TK2MSFTNGP03.phx.gbl...
>> Yes, overwrite is allowed. what is the error msgs when you try to
>> overwrite the file?
>> access denied ? it could be relate to IIS caching.
>> The old KB has been taken down, in the past I have seen this before
>> http://support.qualtrax.com/replicat...h/00024032.HTM
>>
>> immediate overwrite will cause the error. yet it is not recommended to
>> disable caching as the parameter affect entire IIS and not just FTP.
>>
>> --
>> Regards,
>> Bernard Cheah
>> http://www.iis.net/
>> http://msmvps.com/blogs/bernard/
>>
>>
>> "Pheasant Plucker" <pheasant@plucker.not> wrote in message
>> news:%23A4IdLWDJHA.340@TK2MSFTNGP03.phx.gbl...
>>> Hi there,
>>>
>>> I have an application that is able to upload a .gif image file with the
>>> same name into a folder every minute.
>>>
>>> I have setup the FTP Service from IIS6.0 under Server 2003
>>>
>>> The application finds the folder with no problem & uploads the file.
>>>
>>> However it will not overwrite the 'gif file preferring instead to name
>>> the file by date and with a .tmp file extension which increases by 60
>>> every hour!
>>>
>>> If I rename the .tmp to .gif then it displays as one would expect a .gif
>>> file to display so it is not a .tmp file in the best sense of the
>>> word...
>>>
>>> So my question is;
>>>
>>> Does the IIS FTP Service allow a file to be overwritten?
>>>
>>> I am guessing the application uses what would be the standard 'Put'
>>> command...
>>>
>>> If it doesn't allow an overwrite is there a work-round? For example a
>>> command line switch or alternative to the 'Put' command that will force
>>> an overwrite?
>>>
>>> Am I even correct about the inability of the FTP Service from IIS 6.0 to
>>> allow an overwrite of an existing file with another file that has the
>>> same name and if so is there a document from Microsoft that documents
>>> this behaviour?
>>>
>>> Thanks & regards,
>>> -=pp=-
>>>
>>>
>>> --
>>> Thanks & regards,
>>> -=pp=-
>>>

>>
>>

>
>



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:02 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.