В данной статье описывается проблема, возникающая в службе FTP на компьютере под управлением Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Пакет обновления 1 (SP1) для Windows 7 или Windows Server 2008 R2 с пакетом обновления 1. Доступно исправление для решения этой проблемы. Исправление с условием.
Симптомы
Эта проблема возникает при попытке загрузить файл, пока выполняется запись файла, даже если файл был открыт в приложение, которое выполняет запись в файл, указав значение FILE_SHARE_READ для режим общего доступа. При возникновении этой проблемы не удается загрузить файл, и служба FTP возвращает сообщение об ошибке, подобное приведенному ниже:
550 процесс файл недоступен, поскольку он используется другим процессом.
Сведения об исправлении
Важно. Языковой пакет не следует устанавливать после установки этого исправления. В противном случае языковые изменения в исправление не будет применяться, и будет необходимо повторно установить исправление. Дополнительные сведения содержатся в статье Установка языковых пакетов для Windows.
Существует исправление от корпорации Майкрософт. Однако данное исправление предназначено для устранения только проблемы, описанной в этой статье. Применяйте данное исправление только в тех системах, которые имеют данную проблему.
Если исправление доступно для скачивания, имеется раздел «Пакет исправлений доступен для скачивания» в верхней части этой статьи базы знаний. Если этого раздела нет, отправьте запрос в службу технической поддержки для получения исправления.
Примечание. Если наблюдаются другие проблемы или необходимо устранить неполадки, вам может понадобиться создать отдельный запрос на обслуживание. Стандартная оплата за поддержку будет взиматься только за дополнительные вопросы и проблемы, которые не соответствуют требованиям конкретного исправления. Полный список телефонов поддержки и обслуживания клиентов корпорации Майкрософт или создать отдельный запрос на обслуживание посетите следующий веб-узел корпорации Майкрософт:
http://support.microsoft.com/contactus/?ws=supportПримечание. В форме «Пакет исправлений доступен для скачивания» отображаются языки, для которых доступно исправление. Если нужный язык не отображается, значит исправление для данного языка отсутствует.
Предварительные условия
Для установки этого исправления необходимо иметь апреля 2014 накопительный пакет обновления для Windows RT 8.1, Windows 8.1 и Windows Server 2012 R2 (2919355) , установленной в Windows Server 2012 R2 или Windows 8.1. Или установите Пакет обновления 1 для Windows 7 или Windows Server 2008 R2.
Сведения о реестре
Для использования исправления из этого пакета нет необходимости вносить изменения в реестр.
Необходимость перезагрузки
Может потребоваться перезагрузить компьютер после установки данного исправления.
Сведения о замене исправлений
Это исправление не заменяет ранее выпущенные исправления.
Глобальная версия этого исправления устанавливает файлы с атрибутами, указанными в приведенных ниже таблицах. Дата и время для файлов указаны в формате UTC. Дата и время для файлов на локальном компьютере отображаются в местном времени с вашим текущим смещением летнего времени (DST). Кроме того, при выполнении определенных операций с файлами, даты и время могут изменяться.
Сведения о файле Windows 8.1 и Windows Server 2012 R2 и заметки
Важно. Windows Server 2012 R2 исправления и исправления Windows 8.1 включаются в тех же самых пакетов. Однако исправления на странице запроса исправлений перечислены под обеими операционными системами. Для получения пакета исправлений, который применяется к одной или обеих операционных систем, установите исправления, перечисленные в разделе «Windows 8.1/Windows Server 2012 R2» на странице. Всегда смотрите раздел «Информация в данной статье относится к следующим продуктам» статьи для определения фактических операционных систем, к которым применяется каждое исправление.
-
Файлы МАНИФЕСТА (.manifest) и MUM (.mum), устанавливаемые для каждой среды
указаны отдельно в разделе «сведения о дополнительных файлах для Windows 8.1 и Windows Server 2012 R2». MUM, MANIFEST и связанные файлы каталога безопасности (.cat) очень важны для поддержания состояния обновленных компонентов. Файлы каталога безопасности, для которых не перечислены атрибуты, подписаны цифровой подписью корпорации Майкрософт.
Для всех поддерживаемых 32-разрядных версий Windows 8.1
|
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
|---|---|---|---|---|---|
|
Ftpconfigext.dll |
8.5.9600.17725 |
16,896 |
11-Mar-2015 |
01:05 |
x86 |
|
Ftpctrlps.dll |
8.5.9600.17725 |
10,240 |
11-Mar-2015 |
01:17 |
x86 |
|
Ftpmib.dll |
8.5.9600.17725 |
10 752 |
11-Mar-2015 |
01:15 |
x86 |
|
Ftpres.dll |
8.5.9600.16384 |
14,848 |
22-Aug-2013 |
04:16 |
x86 |
|
Ftpsvc.dll |
8.5.9600.17725 |
344,064 |
11-Mar-2015 |
00:57 |
x86 |
|
Ftpsvc.mof |
Неприменимо |
69,990 |
21-Aug-2013 |
23:46 |
Неприменимо |
Для всех поддерживаемых 64-разрядных версий Windows 8.1 и Windows Server 2012 R2
|
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
|---|---|---|---|---|---|
|
Ftpconfigext.dll |
8.5.9600.17725 |
19,968 |
11-Mar-2015 |
01:44 |
x64 |
|
Ftpctrlps.dll |
8.5.9600.17725 |
14,848 |
11-Mar-2015 |
01:59 |
x64 |
|
Ftpmib.dll |
8.5.9600.17725 |
13,312 |
11-Mar-2015 |
01:56 |
x64 |
|
Ftpres.dll |
8.5.9600.16384 |
14,848 |
22-Aug-2013 |
11:44 |
x64 |
|
Ftpsvc.dll |
8.5.9600.17725 |
393,216 |
11-Mar-2015 |
01:33 |
x64 |
|
Ftpsvc.mof |
Неприменимо |
69,990 |
22-Aug-2013 |
06:51 |
Неприменимо |
Сведения о файле Windows 8 и Windows Server 2012 и заметки
Важно. Исправления для Windows Server 2012 и Windows 8 исправления включены в те же пакеты. Однако исправления на странице запроса исправлений перечислены под обеими операционными системами. Чтобы запросить пакет исправлений, который применяется к одной или обеих операционных систем, установите исправление, описанное в разделе «Windows 8 и Windows Server 2012» на странице. Всегда смотрите раздел «Информация в данной статье относится к следующим продуктам» статьи для определения фактических операционных систем, к которым применяется каждое исправление.
-
Файлы МАНИФЕСТА (.manifest) и MUM (.mum), устанавливаемые для каждой среды
указаны отдельно в разделе «сведения о дополнительных файлах для Windows 7 и Windows Server 2008 R2». MUM, MANIFEST и связанные файлы каталога безопасности (.cat) очень важны для поддержания состояния обновленных компонентов. Файлы каталога безопасности, для которых не перечислены атрибуты, подписаны цифровой подписью корпорации Майкрософт.
Для всех поддерживаемых версий Windows 8 для систем на базе x86
|
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
|---|---|---|---|---|---|
|
Ftpconfigext.dll |
8.0.9200.16384 |
15,360 |
26-Jul-2012 |
03:18 |
x86 |
|
Ftpctrlps.dll |
8.0.9200.16384 |
10,240 |
26-Jul-2012 |
03:18 |
x86 |
|
Ftpmib.dll |
8.0.9200.16384 |
10 752 |
26-Jul-2012 |
03:18 |
x86 |
|
Ftpres.dll |
8.0.9200.16384 |
14,848 |
26-Jul-2012 |
02:44 |
x86 |
|
Ftpsvc.dll |
8.0.9200.21616 |
319,488 |
07-Sep-2015 |
15:17 |
x86 |
|
Ftpsvc.mof |
Неприменимо |
69,990 |
25-Jul-2012 |
20:18 |
Неприменимо |
Для всех поддерживаемых версий x64 под управлением Windows 8 и Windows Server 2012
|
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
|---|---|---|---|---|---|
|
Ftpconfigext.dll |
8.0.9200.16384 |
17,920 |
26-Jul-2012 |
03:05 |
x64 |
|
Ftpctrlps.dll |
8.0.9200.16384 |
14,336 |
26-Jul-2012 |
03:05 |
x64 |
|
Ftpmib.dll |
8.0.9200.16384 |
13,312 |
26-Jul-2012 |
03:05 |
x64 |
|
Ftpres.dll |
8.0.9200.16384 |
14,848 |
26-Jul-2012 |
02:34 |
x64 |
|
Ftpsvc.dll |
8.0.9200.21616 |
369,664 |
07-Sep-2015 |
14:23 |
x64 |
|
Ftpsvc.mof |
Неприменимо |
69,990 |
25-Jul-2012 |
20:16 |
Неприменимо |
Сведения о файле Windows 7 и Windows Server 2008 R2 и заметки
Важно. Исправления для Windows Server 2008 R2 и Windows 7 включены в одни и те же пакеты. Однако исправления на странице запроса исправлений перечислены под обеими операционными системами. Чтобы запросить пакет исправления, который применяется к одной или обеим ОС, установите исправление, описанное в разделе «Windows 7/Windows Server 2008 R2» страницы. Всегда смотрите раздел «Информация в данной статье относится к следующим продуктам» статьи для определения фактических операционных систем, к которым применяется каждое исправление.
-
Файлы МАНИФЕСТА (.manifest) и MUM (.mum), устанавливаемые для каждой среды
указаны отдельно в разделе «сведения о дополнительных файлах для Windows 7 и Windows Server 2008 R2». MUM, MANIFEST и связанные файлы каталога безопасности (.cat) очень важны для поддержания состояния обновленных компонентов. Файлы каталога безопасности, для которых не перечислены атрибуты, подписаны цифровой подписью корпорации Майкрософт.
Для всех поддерживаемых 86-разрядных версий Windows 7
|
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
|---|---|---|---|---|---|
|
Ftpconfigext.dll |
7.5.7601.22982 |
16 384 |
05-Mar-2015 |
04:10 |
x86 |
|
Ftpctrlps.dll |
7.5.7601.22982 |
9,728 |
05-Mar-2015 |
04:10 |
x86 |
|
Ftpmib.dll |
7.5.7601.22982 |
10,240 |
05-Mar-2015 |
04:10 |
x86 |
|
Ftpres.dll |
7.5.7601.22982 |
14,848 |
05-Mar-2015 |
04:06 |
x86 |
|
Ftpsvc.dll |
7.5.7601.22982 |
310,272 |
05-Mar-2015 |
04:10 |
x86 |
|
Ftpsvc.mof |
Неприменимо |
69,252 |
05-Mar-2015 |
01:25 |
Неприменимо |
Для всех поддерживаемых 64-разрядных версий Windows 7 и Windows Server 2008 R2
|
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
|---|---|---|---|---|---|
|
Ftpconfigext.dll |
7.5.7601.22982 |
18,432 |
05-Mar-2015 |
04:23 |
x64 |
|
Ftpctrlps.dll |
7.5.7601.22982 |
13,824 |
05-Mar-2015 |
04:23 |
x64 |
|
Ftpmib.dll |
7.5.7601.22982 |
12 800 |
05-Mar-2015 |
04:23 |
x64 |
|
Ftpres.dll |
7.5.7601.22982 |
14,848 |
05-Mar-2015 |
04:19 |
x64 |
|
Ftpsvc.dll |
7.5.7601.22982 |
351,232 |
05-Mar-2015 |
04:23 |
x64 |
|
Ftpsvc.mof |
Неприменимо |
69,252 |
05-Mar-2015 |
01:15 |
Неприменимо |
Для всех поддерживаемых версий Windows Server 2008 R2 для систем на базе процессоров IA-64
|
Имя файла |
Версия файла |
Размер файла |
Дата |
Время |
Платформа |
|---|---|---|---|---|---|
|
Ftpconfigext.dll |
7.5.7601.22982 |
40,960 |
05-Mar-2015 |
03:31 |
IA-64 |
|
Ftpctrlps.dll |
7.5.7601.22982 |
22,528 |
05-Mar-2015 |
03:31 |
IA-64 |
|
Ftpmib.dll |
7.5.7601.22982 |
23,552 |
05-Mar-2015 |
03:31 |
IA-64 |
|
Ftpres.dll |
7.5.7601.22982 |
14,848 |
05-Mar-2015 |
03:27 |
IA-64 |
|
Ftpsvc.dll |
7.5.7601.22982 |
786,432 |
05-Mar-2015 |
03:31 |
IA-64 |
|
Ftpsvc.mof |
Неприменимо |
69,252 |
05-Mar-2015 |
01:07 |
Неприменимо |
Сведения о дополнительных файлах
Сведения о дополнительных файлах для Windows 8.1 и для Windows Server 2012 R2
Дополнительные файлы для всех поддерживаемых 32-разрядных версий Windows 8.1
|
Свойства файла |
Значение |
|---|---|
|
Имя файла |
X86_88477c24b79c92385578f0352a6516ea_31bf3856ad364e35_6.3.9600.17725_none_5ff770c55b197b27.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
698 |
|
Дата (UTC) |
11-Mar-2015 |
|
Время (UTC) |
18:44 |
|
Платформа |
Неприменимо |
|
Имя файла |
X86_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.3.9600.17725_none_df4cabbbb108f83e.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
25,960 |
|
Дата (UTC) |
11-Mar-2015 |
|
Время (UTC) |
18:48 |
|
Платформа |
Неприменимо |
Дополнительные файлы для всех поддерживаемых версий на базе x64 Windows 8.1 и Windows Server 2012 R2
|
Свойства файла |
Значение |
|---|---|
|
Имя файла |
Amd64_4c334a7f318e7e5b0bdf61bacbd3b9cd_31bf3856ad364e35_6.3.9600.17725_none_840b577ca9139d62.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
1,046 |
|
Дата (UTC) |
11-Mar-2015 |
|
Время (UTC) |
18:44 |
|
Платформа |
Неприменимо |
|
Имя файла |
Amd64_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.3.9600.17725_none_3b6b473f69666974.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
25,966 |
|
Дата (UTC) |
11-Mar-2015 |
|
Время (UTC) |
18:44 |
|
Платформа |
Неприменимо |
|
Имя файла |
Wow64_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.3.9600.17725_none_45bff1919dc72b6f.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
11,518 |
|
Дата (UTC) |
11-Mar-2015 |
|
Время (UTC) |
02:14 |
|
Платформа |
Неприменимо |
Сведения о дополнительных файлах для Windows 8 и Windows Server 2012
Дополнительные файлы для всех поддерживаемых версий Windows 8 для систем на базе x86
|
Свойства файла |
Значение |
|---|---|
|
Имя файла |
Update.mum |
|
Версия файла |
Неприменимо |
|
Размер файла |
1,796 |
|
Дата (UTC) |
07-Sep-2015 |
|
Время (UTC) |
20:09 |
|
Платформа |
Неприменимо |
|
Имя файла |
X86_45c1a58d100ee3357dacc59a34b0a8c1_31bf3856ad364e35_6.2.9200.21616_none_685dff9493f2bf6a.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
698 |
|
Дата (UTC) |
07-Sep-2015 |
|
Время (UTC) |
20:09 |
|
Платформа |
Неприменимо |
|
Имя файла |
X86_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.2.9200.21616_none_47ed5c4a7feacaa3.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
25,960 |
|
Дата (UTC) |
07-Sep-2015 |
|
Время (UTC) |
20:13 |
|
Платформа |
Неприменимо |
Дополнительные файлы для всех поддерживаемых версий x64 под управлением Windows 8 и Windows Server 2012
|
Свойства файла |
Значение |
|---|---|
|
Имя файла |
Amd64_b087fa0c367f7370602f10d4508f20b2_31bf3856ad364e35_6.2.9200.21616_none_f2e8ac0ad63dacec.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
1,046 |
|
Дата (UTC) |
07-Sep-2015 |
|
Время (UTC) |
20:09 |
|
Платформа |
Неприменимо |
|
Имя файла |
Amd64_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.2.9200.21616_none_a40bf7ce38483bd9.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
25,966 |
|
Дата (UTC) |
07-Sep-2015 |
|
Время (UTC) |
20:09 |
|
Платформа |
Неприменимо |
|
Имя файла |
Update.mum |
|
Версия файла |
Неприменимо |
|
Размер файла |
2,014 |
|
Дата (UTC) |
07-Sep-2015 |
|
Время (UTC) |
20:09 |
|
Платформа |
Неприменимо |
|
Имя файла |
Wow64_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.2.9200.21616_none_ae60a2206ca8fdd4.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
11,518 |
|
Дата (UTC) |
07-Sep-2015 |
|
Время (UTC) |
15:37 |
|
Платформа |
Неприменимо |
Сведения о дополнительных файлах для Windows 7 и Windows Server 2008 R2
Дополнительные файлы для всех поддерживаемых 86-разрядных версий Windows 7
|
Свойства файла |
Значение |
|---|---|
|
Имя файла |
X86_e4fb02832e7fb01c91d04ed77281e7c7_31bf3856ad364e35_6.1.7601.22982_none_6e54d57c40f84bd9.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
698 |
|
Дата (UTC) |
05-Mar-2015 |
|
Время (UTC) |
18:10 |
|
Платформа |
Неприменимо |
|
Имя файла |
X86_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.1.7601.22982_none_4cae5c2b0d3b3de6.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
29,360 |
|
Дата (UTC) |
05-Mar-2015 |
|
Время (UTC) |
04:38 |
|
Платформа |
Неприменимо |
Дополнительные файлы для всех поддерживаемых 64-разрядных версий Windows 7 и Windows Server 2008 R2
|
Свойства файла |
Значение |
|---|---|
|
Имя файла |
Amd64_b93790dbe7a40a5efb8702b6f12cedf6_31bf3856ad364e35_6.1.7601.22982_none_d9aeae6490df6469.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
1,046 |
|
Дата (UTC) |
05-Mar-2015 |
|
Время (UTC) |
18:11 |
|
Платформа |
Неприменимо |
|
Имя файла |
Amd64_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.1.7601.22982_none_a8ccf7aec598af1c.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
29,366 |
|
Дата (UTC) |
05-Mar-2015 |
|
Время (UTC) |
04:48 |
|
Платформа |
Неприменимо |
|
Имя файла |
Wow64_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.1.7601.22982_none_b321a200f9f97117.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
11,568 |
|
Дата (UTC) |
05-Mar-2015 |
|
Время (UTC) |
04:33 |
|
Платформа |
Неприменимо |
Дополнительные файлы для всех поддерживаемых версий Windows Server 2008 R2 с архитектурой IA-64
|
Свойства файла |
Значение |
|---|---|
|
Имя файла |
Ia64_157ca3abf4ced819a8b64f4c9aa67d48_31bf3856ad364e35_6.1.7601.22982_none_8bde54fca1a45ba4.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
1,044 |
|
Дата (UTC) |
05-Mar-2015 |
|
Время (UTC) |
18:10 |
|
Платформа |
Неприменимо |
|
Имя файла |
Ia64_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.1.7601.22982_none_4cb000210d3946e2.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
29,363 |
|
Дата (UTC) |
05-Mar-2015 |
|
Время (UTC) |
04:21 |
|
Платформа |
Неприменимо |
|
Имя файла |
Wow64_microsoft-windows-iis-ftpsvc_31bf3856ad364e35_6.1.7601.22982_none_b321a200f9f97117.manifest |
|
Версия файла |
Неприменимо |
|
Размер файла |
11,568 |
|
Дата (UTC) |
05-Mar-2015 |
|
Время (UTC) |
04:33 |
|
Платформа |
Неприменимо |
Статус
Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».
Ссылки
См. термины , которые корпорация Майкрософт использует для описания обновлений программного обеспечения.
I have created a small windows forms application to upload the file to one of our client’s ftp site. But the problem that I’m having is that when I run this application on my local machine it uploads the file successfully. But if I run this program on our server, I get this error message;
remote server returned an error: (550) File unavailable (eg, file not found, can not access the file), on this line ‘objFTPRequest.GetRequestStream();’.
Does anybody know why? Do I need to configure the firewall or something? Here is my code;
FileInfo objFile = new FileInfo(filename);
FtpWebRequest objFTPRequest;
// Create FtpWebRequest object
objFTPRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/outbox/" + objFile.Name));
// Set Credintials
objFTPRequest.Credentials = new NetworkCredential(ftpUserName, ftpPassword);
// By default KeepAlive is true, where the control connection is
// not closed after a command is executed.
objFTPRequest.KeepAlive = false;
// Set the data transfer type.
objFTPRequest.UseBinary = true;
// Set content length
objFTPRequest.ContentLength = objFile.Length;
// Set request method
objFTPRequest.Method = WebRequestMethods.Ftp.UploadFile;
// Set buffer size
int intBufferLength = 16 * 1024;
byte[] objBuffer = new byte[intBufferLength];
// Opens a file to read
FileStream objFileStream = objFile.OpenRead();
// Get Stream of the file
Stream objStream = objFTPRequest.GetRequestStream();
int len = 0;
while ((len = objFileStream.Read(objBuffer, 0, intBufferLength)) != 0)
{
// Write file Content
objStream.Write(objBuffer, 0, len);
}
objStream.Close();
objFileStream.Close();
asked Jul 4, 2013 at 13:37
chosenOne ThabschosenOne Thabs
1,4243 gold badges20 silver badges38 bronze badges
I met the same problem, and this is what I did:
- Check the OS has the right to write. Find the ftp folder =>right
click=>properties=>security, then you must know what you should do - Check the ftp server open the write right to the user you logged. Open IIS=>click the ftp site=>ftp Authorization Rules=>add allow rules=>choose a user or group to set the rights
- Check the the dir on the ftp server, do the same thing on item 2.
I can use four pictures to show the rights to be set:




Irshad
3,0335 gold badges28 silver badges51 bronze badges
answered Jul 9, 2013 at 17:07
2
It could be more simple.
I facing similar issue and i tried all the suggested solution but no one work.
I’m figure out in simple manner like this one : take a look
Wrong code at my end
Dim request As Net.FtpWebRequest = CType(FtpWebRequest.Create("ftp://xxx.xxx.xxx.xxx/files"), FtpWebRequest)
Change it in this simple one :
Dim request As Net.FtpWebRequest = CType(FtpWebRequest.Create("ftp://xxx.xxx.xxx.xxx/files/youfilename.ext"), FtpWebRequest)
then procced with fill request and send to server 🙂
That’s all.
Make sure that all permission on server work fine and u’re using right credential.
answered Apr 3, 2014 at 20:31
1
I found the solution. The problem is the Current Working Directory of the ftp user. If you type a url like ftp:///path/test.txt it is used as a relative path ro the working directory. For example CWD is /test then the used path is /test/path/test.txt. If you want to use an absolute path, you have to type the url like ftp:////path/test.txt. Then the file is uploaded in the folder /path/test.txt, without exception.
answered Oct 1, 2018 at 7:16
shamsham
6817 silver badges25 bronze badges
In order to resolve this issue, it is required to force the System.Net.FtpWebRequest command to revert back to the old behavior of how it used to work in .Net Framework 2.0/3.5 and issue the extra CWD command before issuing the actual command.
In order to do this, the following code needs to be placed before any instance of the System.Net.FtpWebRequest class is invoked.
The code below only needs to be called once, since it changes the settings of the entire application domain.
private static void SetMethodRequiresCWD()
{
Type requestType = typeof(FtpWebRequest);
FieldInfo methodInfoField = requestType.GetField("m_MethodInfo", BindingFlags.NonPublic | BindingFlags.Instance);
Type methodInfoType = methodInfoField.FieldType;
FieldInfo knownMethodsField = methodInfoType.GetField("KnownMethodInfo", BindingFlags.Static | BindingFlags.NonPublic);
Array knownMethodsArray = (Array)knownMethodsField.GetValue(null);
FieldInfo flagsField = methodInfoType.GetField("Flags", BindingFlags.NonPublic | BindingFlags.Instance);
int MustChangeWorkingDirectoryToPath = 0x100;
foreach (object knownMethod in knownMethodsArray)
{
int flags = (int)flagsField.GetValue(knownMethod);
flags |= MustChangeWorkingDirectoryToPath;
flagsField.SetValue(knownMethod, flags);
}
}
http://support.microsoft.com/kb/2134299
answered Nov 6, 2013 at 21:44
Taras KravetsTaras Kravets
1,3534 gold badges13 silver badges15 bronze badges
Make sure target folder «outbox» exists.
That was my problem with error 550.
Simply create target directory «output» before upload.
try
{
WebRequest request = WebRequest.Create("ftp://" + ftpServerIP + "/outbox");
request.Credentials = new NetworkCredential("user", "password");
request.Method = WebRequestMethods.Ftp.MakeDirectory;
using (var resp = (FtpWebResponse)request.GetResponse())
{
Console.WriteLine(resp.StatusCode);
}
}
catch (WebException ex)
{
FtpWebResponse response = (FtpWebResponse)ex.Response;
if (response.StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable)
{
response.Close();
//already exists
}
else
{
response.Close();
//doesn't exists = it's another exception
}
}
answered Jul 31, 2017 at 12:30
![]()
I had this problem. Filezilla was fine, .net wasn’t. It was to a wordpress server.
To get it working, I changed the my code from this:
ftp://XXX.XXX.XXX.XXX//folder//» + txtFile.Text
to:
ftp://[FTPNAME]@XXX.XXX.XXX.XXX//» + txtFile.Text
and it now thankfully works.
I don’t know if this is specific to WordPress FTP folders.
answered Oct 25, 2017 at 9:43
![]()
In my case, there was a root folder referenced in my ftp address that was missing.
After to create the folder the problem was solved.
ftp://xxx.xxx.xx.xx:21//rootfolder/
answered Mar 16, 2018 at 18:04
![]()
I was also having the same issue. After monitoring the traffic with WireShark I understood the problem
I had set up a new FTP site on my local IIS FTP server named ‘testftp’
The ‘testftp’ site was pointing to a folder named d:ftp on my computer’s hard disk
I was getting the ‘550’ error whenever i tried to execute the line in bold in C# code below
ftpHostURL=»ftp://127.0.0.1/testftp/test.htm»;
request = (FtpWebRequest)WebRequest.Create(ftpHostURL);
request.Proxy = new WebProxy(); //——Proxy bypassing(The requested FTP command is not supported when using HTTP proxy)
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential(ftpUserName, ftpPassword);
// uploadFilePath = "d://test//tt.txt";
using (var requestStream = request.GetRequestStream())
{
using (var input = File.OpenRead(uploadFilePath))
{
input.CopyTo(requestStream);
}
}
I tried a lot of solutions mentioned in various websites but nothing helped. Then I came across a site that suggested to use WireShark to monitor the traffic.
On monitoring the traffic using the RawCap Utility I saw that the application was trying to execute the code below
STOR testftp/test.htm
Then I understood the problem. IIS was expecting a folder named ‘testftp‘ to be there under the ftp root folder which was not there.
I was considering ‘testftp‘ as the name of the virtual folder created in IIS where as IIS understood it as a folder under the FTP root
Creating a folder named ‘testftp‘ under the FTP root folder solved my issue.
Hope this is helpful to someone
Regards
Mathew
answered Nov 5, 2019 at 5:49
mjk6035mjk6035
891 silver badge9 bronze badges
Just to throw my hat in the ring, I was getting the same error. When the FTPRequest was requesting files from the FTP Service on the same computer (same IP). In the request I was using the IP address of the machine but once I changed that to 127.0.0.1 it worked. interestingly enough, requests from other IP addresses were being processed and files downloaded, just not from itself.
Hope that helped someone.
answered Nov 16, 2015 at 1:50
dellyjmdellyjm
4181 gold badge5 silver badges10 bronze badges
When i had the same issue i tried everything above and after a day later i realize that the path which i created for uri having a white space in between «/» and the folder name
string uri="192.168.1.101/ Sync/Image.jpg";
the above string should be
string uri="192.168.1.101/Sync/Image.jpg";
this small mistake also throws the same error and it’s a valid error because this is not valid path for our file if it contains any white spaces between «/» and folder/file name
answered Sep 15, 2016 at 9:14
![]()
I was having the same problem, when i compared with the ftpuri and User Name Path it is resolved
When I create ftp access i have chose the path as /directory name
in the ftpuri when i included the directory name it gave the error and when i removed the directory name it is resolved.
ftpuri with error
«ftp://www.example.com/Project/yourfilename.ds»
ftpuri resolved
«ftp://www.example.com/yourfilename.ds»
ftp access folder
«/Project»
answered Jan 11, 2017 at 15:56
I too had this problem recently. What I found is that when I use ftpUploadFile the routine is trying to put the file in the root ftp folder. Normal command line ftp worked fine. However issuing a pwd command from the command line ftp revealed that this particular server was setting a different current directory upon login. Altering my ftpUploadFile to include this folder resolved the issue.
answered Feb 1, 2017 at 13:54
user2709214user2709214
1852 silver badges12 bronze badges
I have created a small windows forms application to upload the file to one of our client’s ftp site. But the problem that I’m having is that when I run this application on my local machine it uploads the file successfully. But if I run this program on our server, I get this error message;
remote server returned an error: (550) File unavailable (eg, file not found, can not access the file), on this line ‘objFTPRequest.GetRequestStream();’.
Does anybody know why? Do I need to configure the firewall or something? Here is my code;
FileInfo objFile = new FileInfo(filename);
FtpWebRequest objFTPRequest;
// Create FtpWebRequest object
objFTPRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/outbox/" + objFile.Name));
// Set Credintials
objFTPRequest.Credentials = new NetworkCredential(ftpUserName, ftpPassword);
// By default KeepAlive is true, where the control connection is
// not closed after a command is executed.
objFTPRequest.KeepAlive = false;
// Set the data transfer type.
objFTPRequest.UseBinary = true;
// Set content length
objFTPRequest.ContentLength = objFile.Length;
// Set request method
objFTPRequest.Method = WebRequestMethods.Ftp.UploadFile;
// Set buffer size
int intBufferLength = 16 * 1024;
byte[] objBuffer = new byte[intBufferLength];
// Opens a file to read
FileStream objFileStream = objFile.OpenRead();
// Get Stream of the file
Stream objStream = objFTPRequest.GetRequestStream();
int len = 0;
while ((len = objFileStream.Read(objBuffer, 0, intBufferLength)) != 0)
{
// Write file Content
objStream.Write(objBuffer, 0, len);
}
objStream.Close();
objFileStream.Close();
asked Jul 4, 2013 at 13:37
chosenOne ThabschosenOne Thabs
1,4243 gold badges20 silver badges38 bronze badges
I met the same problem, and this is what I did:
- Check the OS has the right to write. Find the ftp folder =>right
click=>properties=>security, then you must know what you should do - Check the ftp server open the write right to the user you logged. Open IIS=>click the ftp site=>ftp Authorization Rules=>add allow rules=>choose a user or group to set the rights
- Check the the dir on the ftp server, do the same thing on item 2.
I can use four pictures to show the rights to be set:




Irshad
3,0335 gold badges28 silver badges51 bronze badges
answered Jul 9, 2013 at 17:07
2
It could be more simple.
I facing similar issue and i tried all the suggested solution but no one work.
I’m figure out in simple manner like this one : take a look
Wrong code at my end
Dim request As Net.FtpWebRequest = CType(FtpWebRequest.Create("ftp://xxx.xxx.xxx.xxx/files"), FtpWebRequest)
Change it in this simple one :
Dim request As Net.FtpWebRequest = CType(FtpWebRequest.Create("ftp://xxx.xxx.xxx.xxx/files/youfilename.ext"), FtpWebRequest)
then procced with fill request and send to server 🙂
That’s all.
Make sure that all permission on server work fine and u’re using right credential.
answered Apr 3, 2014 at 20:31
1
I found the solution. The problem is the Current Working Directory of the ftp user. If you type a url like ftp:///path/test.txt it is used as a relative path ro the working directory. For example CWD is /test then the used path is /test/path/test.txt. If you want to use an absolute path, you have to type the url like ftp:////path/test.txt. Then the file is uploaded in the folder /path/test.txt, without exception.
answered Oct 1, 2018 at 7:16
shamsham
6817 silver badges25 bronze badges
In order to resolve this issue, it is required to force the System.Net.FtpWebRequest command to revert back to the old behavior of how it used to work in .Net Framework 2.0/3.5 and issue the extra CWD command before issuing the actual command.
In order to do this, the following code needs to be placed before any instance of the System.Net.FtpWebRequest class is invoked.
The code below only needs to be called once, since it changes the settings of the entire application domain.
private static void SetMethodRequiresCWD()
{
Type requestType = typeof(FtpWebRequest);
FieldInfo methodInfoField = requestType.GetField("m_MethodInfo", BindingFlags.NonPublic | BindingFlags.Instance);
Type methodInfoType = methodInfoField.FieldType;
FieldInfo knownMethodsField = methodInfoType.GetField("KnownMethodInfo", BindingFlags.Static | BindingFlags.NonPublic);
Array knownMethodsArray = (Array)knownMethodsField.GetValue(null);
FieldInfo flagsField = methodInfoType.GetField("Flags", BindingFlags.NonPublic | BindingFlags.Instance);
int MustChangeWorkingDirectoryToPath = 0x100;
foreach (object knownMethod in knownMethodsArray)
{
int flags = (int)flagsField.GetValue(knownMethod);
flags |= MustChangeWorkingDirectoryToPath;
flagsField.SetValue(knownMethod, flags);
}
}
http://support.microsoft.com/kb/2134299
answered Nov 6, 2013 at 21:44
Taras KravetsTaras Kravets
1,3534 gold badges13 silver badges15 bronze badges
Make sure target folder «outbox» exists.
That was my problem with error 550.
Simply create target directory «output» before upload.
try
{
WebRequest request = WebRequest.Create("ftp://" + ftpServerIP + "/outbox");
request.Credentials = new NetworkCredential("user", "password");
request.Method = WebRequestMethods.Ftp.MakeDirectory;
using (var resp = (FtpWebResponse)request.GetResponse())
{
Console.WriteLine(resp.StatusCode);
}
}
catch (WebException ex)
{
FtpWebResponse response = (FtpWebResponse)ex.Response;
if (response.StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable)
{
response.Close();
//already exists
}
else
{
response.Close();
//doesn't exists = it's another exception
}
}
answered Jul 31, 2017 at 12:30
![]()
I had this problem. Filezilla was fine, .net wasn’t. It was to a wordpress server.
To get it working, I changed the my code from this:
ftp://XXX.XXX.XXX.XXX//folder//» + txtFile.Text
to:
ftp://[FTPNAME]@XXX.XXX.XXX.XXX//» + txtFile.Text
and it now thankfully works.
I don’t know if this is specific to WordPress FTP folders.
answered Oct 25, 2017 at 9:43
![]()
In my case, there was a root folder referenced in my ftp address that was missing.
After to create the folder the problem was solved.
ftp://xxx.xxx.xx.xx:21//rootfolder/
answered Mar 16, 2018 at 18:04
![]()
I was also having the same issue. After monitoring the traffic with WireShark I understood the problem
I had set up a new FTP site on my local IIS FTP server named ‘testftp’
The ‘testftp’ site was pointing to a folder named d:ftp on my computer’s hard disk
I was getting the ‘550’ error whenever i tried to execute the line in bold in C# code below
ftpHostURL=»ftp://127.0.0.1/testftp/test.htm»;
request = (FtpWebRequest)WebRequest.Create(ftpHostURL);
request.Proxy = new WebProxy(); //——Proxy bypassing(The requested FTP command is not supported when using HTTP proxy)
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential(ftpUserName, ftpPassword);
// uploadFilePath = "d://test//tt.txt";
using (var requestStream = request.GetRequestStream())
{
using (var input = File.OpenRead(uploadFilePath))
{
input.CopyTo(requestStream);
}
}
I tried a lot of solutions mentioned in various websites but nothing helped. Then I came across a site that suggested to use WireShark to monitor the traffic.
On monitoring the traffic using the RawCap Utility I saw that the application was trying to execute the code below
STOR testftp/test.htm
Then I understood the problem. IIS was expecting a folder named ‘testftp‘ to be there under the ftp root folder which was not there.
I was considering ‘testftp‘ as the name of the virtual folder created in IIS where as IIS understood it as a folder under the FTP root
Creating a folder named ‘testftp‘ under the FTP root folder solved my issue.
Hope this is helpful to someone
Regards
Mathew
answered Nov 5, 2019 at 5:49
mjk6035mjk6035
891 silver badge9 bronze badges
Just to throw my hat in the ring, I was getting the same error. When the FTPRequest was requesting files from the FTP Service on the same computer (same IP). In the request I was using the IP address of the machine but once I changed that to 127.0.0.1 it worked. interestingly enough, requests from other IP addresses were being processed and files downloaded, just not from itself.
Hope that helped someone.
answered Nov 16, 2015 at 1:50
dellyjmdellyjm
4181 gold badge5 silver badges10 bronze badges
When i had the same issue i tried everything above and after a day later i realize that the path which i created for uri having a white space in between «/» and the folder name
string uri="192.168.1.101/ Sync/Image.jpg";
the above string should be
string uri="192.168.1.101/Sync/Image.jpg";
this small mistake also throws the same error and it’s a valid error because this is not valid path for our file if it contains any white spaces between «/» and folder/file name
answered Sep 15, 2016 at 9:14
![]()
I was having the same problem, when i compared with the ftpuri and User Name Path it is resolved
When I create ftp access i have chose the path as /directory name
in the ftpuri when i included the directory name it gave the error and when i removed the directory name it is resolved.
ftpuri with error
«ftp://www.example.com/Project/yourfilename.ds»
ftpuri resolved
«ftp://www.example.com/yourfilename.ds»
ftp access folder
«/Project»
answered Jan 11, 2017 at 15:56
I too had this problem recently. What I found is that when I use ftpUploadFile the routine is trying to put the file in the root ftp folder. Normal command line ftp worked fine. However issuing a pwd command from the command line ftp revealed that this particular server was setting a different current directory upon login. Altering my ftpUploadFile to include this folder resolved the issue.
answered Feb 1, 2017 at 13:54
user2709214user2709214
1852 silver badges12 bronze badges
|
Aqeee 0 / 0 / 0 Регистрация: 09.04.2013 Сообщений: 28 |
||||
|
1 |
||||
|
05.05.2014, 22:52. Показов 2413. Ответов 1 Метки нет (Все метки)
Доброго времени суток, форумчане. Недавно начал изучать класс webclient и решил попробовать протестировать его. Столкнулся с ошибкой в 8 строке: Удаленный сервер возвратил ошибку: (550) Файл недоступен (например, не найден или к нему нет доступа).
Возможно я не правильно понял этот класс, но никак не пойму в чём ошибка.
__________________
0 |
|
sk007 Life Builder 532 / 496 / 374 Регистрация: 12.01.2011 Сообщений: 1,752 |
||||
|
06.05.2014, 06:52 |
2 |
|||
|
В этой строчке у вас ссылка становиться вот в такой Код ftp://ftp.host.ru/papkaC:source.txt А такая запись адреса не правильно.
0 |
Я создал небольшое приложение для форм Windows, чтобы загрузить файл на один из наших клиентских ftp-сайтов. Но проблема, с которой я столкнулась, заключается в том, что при запуске этого приложения на моем локальном компьютере он успешно загружает файл. Но если я запустил эту программу на нашем сервере, я получаю это сообщение об ошибке:
удаленный сервер возвратил ошибку: (550) Файл недоступен (например, файл не найден, не может получить доступ к файлу), в этой строке ‘objFTPRequest.GetRequestStream();’.
Кто-нибудь знает, почему? Мне нужно настроить брандмауэр или что-то еще? Вот мой код;
FileInfo objFile = new FileInfo(filename);
FtpWebRequest objFTPRequest;
// Create FtpWebRequest object
objFTPRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/outbox/" + objFile.Name));
// Set Credintials
objFTPRequest.Credentials = new NetworkCredential(ftpUserName, ftpPassword);
// By default KeepAlive is true, where the control connection is
// not closed after a command is executed.
objFTPRequest.KeepAlive = false;
// Set the data transfer type.
objFTPRequest.UseBinary = true;
// Set content length
objFTPRequest.ContentLength = objFile.Length;
// Set request method
objFTPRequest.Method = WebRequestMethods.Ftp.UploadFile;
// Set buffer size
int intBufferLength = 16 * 1024;
byte[] objBuffer = new byte[intBufferLength];
// Opens a file to read
FileStream objFileStream = objFile.OpenRead();
// Get Stream of the file
Stream objStream = objFTPRequest.GetRequestStream();
int len = 0;
while ((len = objFileStream.Read(objBuffer, 0, intBufferLength)) != 0)
{
// Write file Content
objStream.Write(objBuffer, 0, len);
}
objStream.Close();
objFileStream.Close();
04 июль 2013, в 16:06
Поделиться
Источник
11 ответов
Я встретил ту же проблему, и это то, что я сделал:
- Проверить, имеет ли ОС право писать. Найдите папку ftp = > right
click = > properties = > security, то вы должны знать, что вам следует делать - Проверьте, чтобы ftp-сервер открыл право на запись пользователю, которого вы зарегистрировали. Открыть IIS = > щелкнуть по ftp site = > ftp Правила авторизации = > добавить разрешить правила = > выбрать пользователя или группу для установки прав
- Проверьте директорию на ftp-сервере, сделайте то же самое на элементе 2.
Я могу использовать четыре изображения, чтобы показать права, которые нужно установить:




francis
09 июль 2013, в 18:52
Поделиться
Это может быть проще.
Я столкнулся с аналогичной проблемой, и я попробовал все предлагаемое решение, но никто не работал.
Я понимаю, как это выглядит так: взгляните
Неверный код на моем конце
Dim request As Net.FtpWebRequest = CType(FtpWebRequest.Create("ftp://xxx.xxx.xxx.xxx/files"), FtpWebRequest)
Измените его в этом простом:
Dim request As Net.FtpWebRequest = CType(FtpWebRequest.Create("ftp://xxx.xxx.xxx.xxx/files/youfilename.ext"), FtpWebRequest)
затем обработано с запросом на заполнение и отправляется на сервер:)
Что все.
Убедитесь, что все разрешения на сервере работают нормально и используют правильные учетные данные.
makemoney2010
03 апр. 2014, в 21:34
Поделиться
Чтобы решить эту проблему, требуется принудительно заставить команду System.Net.FtpWebRequest вернуться к старому поведению того, как она использовалась для работы в .Net Framework 2.0/3.5 и выдавать дополнительную команду CWD перед выпуском фактическая команда.
Чтобы сделать это, необходимо добавить следующий код перед тем, как вызывается любой экземпляр класса System.Net.FtpWebRequest.
Код ниже нужно только один раз вызывать, так как он изменяет настройки всего домена приложения.
private static void SetMethodRequiresCWD()
{
Type requestType = typeof(FtpWebRequest);
FieldInfo methodInfoField = requestType.GetField("m_MethodInfo", BindingFlags.NonPublic | BindingFlags.Instance);
Type methodInfoType = methodInfoField.FieldType;
FieldInfo knownMethodsField = methodInfoType.GetField("KnownMethodInfo", BindingFlags.Static | BindingFlags.NonPublic);
Array knownMethodsArray = (Array)knownMethodsField.GetValue(null);
FieldInfo flagsField = methodInfoType.GetField("Flags", BindingFlags.NonPublic | BindingFlags.Instance);
int MustChangeWorkingDirectoryToPath = 0x100;
foreach (object knownMethod in knownMethodsArray)
{
int flags = (int)flagsField.GetValue(knownMethod);
flags |= MustChangeWorkingDirectoryToPath;
flagsField.SetValue(knownMethod, flags);
}
}
http://support.microsoft.com/kb/2134299
Taras Kravets
06 нояб. 2013, в 21:45
Поделиться
У меня была эта проблема. Filezilla был в порядке,.net не был. Это был сервер wordpress.
Чтобы заставить его работать, я изменил свой код:
ftp://XXX.XXX.XXX.XXX//folder//» + txtFile.Text
в
ftp://[FTPNAME]@XXX.XXX.XXX.XXX//» + txtFile.Text
и теперь он к счастью работает.
Я не знаю, относится ли это к папкам FTP для WordPress.
BingoCoder
25 окт. 2017, в 11:22
Поделиться
Убедитесь, что целевая папка «исходящие» существует.
Это была моя проблема с ошибкой 550.
Просто создайте целевой файл «output» перед загрузкой.
try
{
WebRequest request = WebRequest.Create("ftp://" + ftpServerIP + "/outbox");
request.Credentials = new NetworkCredential("user", "password");
request.Method = WebRequestMethods.Ftp.MakeDirectory;
using (var resp = (FtpWebResponse)request.GetResponse())
{
Console.WriteLine(resp.StatusCode);
}
}
catch (WebException ex)
{
FtpWebResponse response = (FtpWebResponse)ex.Response;
if (response.StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable)
{
response.Close();
//already exists
}
else
{
response.Close();
//doesn't exists = it another exception
}
}
Jan Macháček
31 июль 2017, в 13:00
Поделиться
У меня тоже была эта проблема в последнее время. Я обнаружил, что когда я использую ftpUploadFile, программа пытается поместить файл в корневую папку ftp. Нормальная командная строка ftp работала нормально. Однако выдача команды pwd из командной строки ftp показала, что этот конкретный сервер устанавливал другой текущий каталог при входе в систему. Изменение моей ftpUploadFile для включения этой папки разрешило проблему.
user2709214
01 фев. 2017, в 14:04
Поделиться
У меня была та же проблема, когда я сравнил с ftpuri и User Name Path, это разрешено
Когда я создаю ftp-доступ, я выбрал путь как /directory name
в ftpuri, когда я включил имя каталога, которое дало ошибку, и когда я удалил имя каталога, оно разрешено.
ftpuri с ошибкой
» ftp://www.example.com/Project/yourfilename.ds»
разрешен ftpuri
» ftp://www.example.com/yourfilename.ds»
папка доступа
ftp
«/Проект»
shankar
11 янв. 2017, в 16:23
Поделиться
Когда у меня была такая же проблема, я пробовал все выше, а через день я понял, что путь, который я создал для uri, имеющего пробел между «/» и именем папки
string uri="192.168.1.101/ Sync/Image.jpg";
указанная строка должна быть
string uri="192.168.1.101/Sync/Image.jpg";
эта небольшая ошибка также выдает ту же ошибку и является допустимой ошибкой, потому что это недопустимый путь для нашего файла, если он содержит любые пробелы между «/» и именем папки/файла
Shrikant Dandile
15 сен. 2016, в 10:21
Поделиться
Просто, чтобы бросить шляпу в кольцо, я получал ту же ошибку. Когда FTPRequest запрашивал файлы из FTP-службы на одном компьютере (тот же IP-адрес). В запросе я использовал IP-адрес устройства, но как только я изменил его на 127.0.0.1, он сработал. Интересно, что запросы с других IP-адресов обрабатывались и загружались файлы, а не от себя.
Надеюсь, что кто-то помог.
dellyjm
16 нояб. 2015, в 03:40
Поделиться
Ещё вопросы
- 0Вызов пользовательского метода из веб-API с использованием angularjs $ resource
- 1Нежелательная кнопка рисования на панели
- 1Ошибка «без имени модуля» после установки модуля
- 0Увеличение целого числа в JavaScript приводит к NaN
- 0Как выйти из цикла ng-Repeat?
- 1Прикрепление файла JSON: «Ошибка типа: индексы списка должны быть целыми или кусочками, а не str»
- 0Функция загрузки JQuery не работает
- 1Шаблон проектирования, обработка сообщений на основе состояния
- 1Как реализовать паттерн наблюдателя с CDI Events?
- 0$ resource, Data.query ({other_id: 1}) извлекает все данные
- 0Проверка процентной доли безотказной работы PHP — требуется помощь
- 0пытаюсь подключиться к локальному серверу используя php (ftp_connect)
- 0Как создавать отчеты Protractor с помощью Jasmine2
- 1Наследование объектов в protobuf-сети
- 0Получение HTML из другого файла с помощью JavaScript
- 0Как получить фактический видовой экран мобильного устройства с размером метапортпорта?
- 0Нужно ли открывать порт MySQL для работы моего приложения DigitalOcean LAMP?
- 0Вызов функции JJuery AJAX внутри каждого
- 0Угловой JS: «это» внутри функции нг-если
- 0Перенаправить определенную страницу на новую страницу с тем же идентификатором
- 0использование angular-ui-router с экспресс / узлом, файловая структура
- 0Среднее из горизонталей данных MySQL PHP
- 0Как установить мою локальную файловую систему в качестве хранилища композитора для моей среды разработки?
- 0JQuery Multi Select передачи с параметрами данных
- 1Реализация события щелчка мыши на плитке на карте
- 1как получить аргумент String внутри функции, возвращаемой как кортеж
- 0DirectX ошибки Vector3
- 1Внедрение Seq2Seq с GRU в Керасе
- 1TCP слушатель получает только первое сообщение
- 1Python: Numpy объединяет массивы в списки 2×1
- 0Не работает директива в угловых
- 0Node.js + Espress + MySQL как хранилище документов (результаты)
- 1Как правильно масштабировать фоновое изображение TextView для Android
- 0Как получить смелый вариант пользовательского шрифта?
- 0MySQL — нет блокировки при выборе строк в таблице
- 1одиночная команда istanbul для нескольких сценариев (или комбинированных отчетов покрытия)
- 0Как смоделировать выпадающий список с вводом?
- 0Поиск сфинкса — исключить из результатов по условию
- 1Время работы экрана на рабочем столе
- 1Штамп растрового изображения на пути — Android
- 1Отправить аудио данные с помощью SMS в Android
- 0Добавление php в код php
- 1Quickbooks Online Rest API отчетности Java ОШИБКА
- 1Google Maps — MapView — нарисуйте хороший маршрут полета между 2 точками
- 0Вставьте таблицу в метку, используя HTML
- 1Как отключить звук определенных источников звука в Unity3D?
- 0Angularjs вход [радио] с уникальной нг-моделью не отключается
- 0Почему каждый раз для локальной переменной выделяется один и тот же адрес?
- 0Отладчик не показывает значения с плавающей точкой в Xcode 5.0.2
- 1Найти первый пустой слот в массиве объектов
Вопрос:
Я хочу загрузить изображение с ftp-сервера, но я получил это исключение как заголовок, когда перешел на “FtpWebResponse”.
Ниже моя функция загрузки
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(myStringWebSource);
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = new NetworkCredential(this.FtpUserID, this.FtpPassword);
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
System.IO.Stream responseStream = response.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(responseStream);
System.IO.StreamWriter writer = new System.IO.StreamWriter(SaveFile);
writer.Write(reader.ReadToEnd());
writer.Close();
reader.Close();
response.Close();
У меня есть это исключение google за несколько дней, но я до сих пор не могу понять, почему это случилось. Если информации недостаточно, plz скажите мне.
Ответ №1
Когда файл, который вы хотите загрузить, используется другим процессом, вы получите эту ошибку.
Ответ №2
Чтобы решить эту проблему, требуется принудительно заставить команду System.Net.FtpWebRequest вернуться к старому поведению того, как она использовалась для работы в .Net Framework 2.0/3.5 и выдавать дополнительную команду CWD перед выпуском фактическая команда.
Чтобы сделать это, необходимо добавить следующий код перед тем, как вызывается любой экземпляр класса System.Net.FtpWebRequest. Код ниже нужно только один раз вызывать, так как он изменяет настройки всего домена приложения.
private static void SetMethodRequiresCWD()
{
Type requestType = typeof(FtpWebRequest);
FieldInfo methodInfoField = requestType.GetField("m_MethodInfo", BindingFlags.NonPublic | BindingFlags.Instance);
Type methodInfoType = methodInfoField.FieldType;
FieldInfo knownMethodsField = methodInfoType.GetField("KnownMethodInfo", BindingFlags.Static | BindingFlags.NonPublic);
Array knownMethodsArray = (Array)knownMethodsField.GetValue(null);
FieldInfo flagsField = methodInfoType.GetField("Flags", BindingFlags.NonPublic | BindingFlags.Instance);
int MustChangeWorkingDirectoryToPath = 0x100;
foreach (object knownMethod in knownMethodsArray)
{
int flags = (int)flagsField.GetValue(knownMethod);
flags |= MustChangeWorkingDirectoryToPath;
flagsField.SetValue(knownMethod, flags);
}
}
http://support.microsoft.com/kb/2134299
I want to download an image from ftp server, but I just got this exception as title when I went to «FtpWebResponse».
Below is my download function
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(myStringWebSource);
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = new NetworkCredential(this.FtpUserID, this.FtpPassword);
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
System.IO.Stream responseStream = response.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(responseStream);
System.IO.StreamWriter writer = new System.IO.StreamWriter(SaveFile);
writer.Write(reader.ReadToEnd());
writer.Close();
reader.Close();
response.Close();
I have google this exception for a few days but I still cannot figure out why this got wrong. If there is not enough information, plz tell me.
kmatyaszek
18.9k9 gold badges57 silver badges64 bronze badges
asked Mar 10, 2013 at 5:43
![]()
When the file which you want to download is being used by another process, you will get this error.
answered Apr 3, 2013 at 22:18
LarryLarry
211 bronze badge
In order to resolve this issue, it is required to force the System.Net.FtpWebRequest command to revert back to the old behavior of how it used to work in .Net Framework 2.0/3.5 and issue the extra CWD command before issuing the actual command.
In order to do this, the following code needs to be placed before any instance of the System.Net.FtpWebRequest class is invoked. The code below only needs to be called once, since it changes the settings of the entire application domain.
private static void SetMethodRequiresCWD()
{
Type requestType = typeof(FtpWebRequest);
FieldInfo methodInfoField = requestType.GetField("m_MethodInfo", BindingFlags.NonPublic | BindingFlags.Instance);
Type methodInfoType = methodInfoField.FieldType;
FieldInfo knownMethodsField = methodInfoType.GetField("KnownMethodInfo", BindingFlags.Static | BindingFlags.NonPublic);
Array knownMethodsArray = (Array)knownMethodsField.GetValue(null);
FieldInfo flagsField = methodInfoType.GetField("Flags", BindingFlags.NonPublic | BindingFlags.Instance);
int MustChangeWorkingDirectoryToPath = 0x100;
foreach (object knownMethod in knownMethodsArray)
{
int flags = (int)flagsField.GetValue(knownMethod);
flags |= MustChangeWorkingDirectoryToPath;
flagsField.SetValue(knownMethod, flags);
}
}
http://support.microsoft.com/kb/2134299
answered Nov 6, 2013 at 21:58
Taras KravetsTaras Kravets
1,3534 gold badges13 silver badges15 bronze badges
I want to download an image from ftp server, but I just got this exception as title when I went to «FtpWebResponse».
Below is my download function
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(myStringWebSource);
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.Credentials = new NetworkCredential(this.FtpUserID, this.FtpPassword);
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
System.IO.Stream responseStream = response.GetResponseStream();
System.IO.StreamReader reader = new System.IO.StreamReader(responseStream);
System.IO.StreamWriter writer = new System.IO.StreamWriter(SaveFile);
writer.Write(reader.ReadToEnd());
writer.Close();
reader.Close();
response.Close();
I have google this exception for a few days but I still cannot figure out why this got wrong. If there is not enough information, plz tell me.
kmatyaszek
18.9k9 gold badges57 silver badges64 bronze badges
asked Mar 10, 2013 at 5:43
![]()
When the file which you want to download is being used by another process, you will get this error.
answered Apr 3, 2013 at 22:18
LarryLarry
211 bronze badge
In order to resolve this issue, it is required to force the System.Net.FtpWebRequest command to revert back to the old behavior of how it used to work in .Net Framework 2.0/3.5 and issue the extra CWD command before issuing the actual command.
In order to do this, the following code needs to be placed before any instance of the System.Net.FtpWebRequest class is invoked. The code below only needs to be called once, since it changes the settings of the entire application domain.
private static void SetMethodRequiresCWD()
{
Type requestType = typeof(FtpWebRequest);
FieldInfo methodInfoField = requestType.GetField("m_MethodInfo", BindingFlags.NonPublic | BindingFlags.Instance);
Type methodInfoType = methodInfoField.FieldType;
FieldInfo knownMethodsField = methodInfoType.GetField("KnownMethodInfo", BindingFlags.Static | BindingFlags.NonPublic);
Array knownMethodsArray = (Array)knownMethodsField.GetValue(null);
FieldInfo flagsField = methodInfoType.GetField("Flags", BindingFlags.NonPublic | BindingFlags.Instance);
int MustChangeWorkingDirectoryToPath = 0x100;
foreach (object knownMethod in knownMethodsArray)
{
int flags = (int)flagsField.GetValue(knownMethod);
flags |= MustChangeWorkingDirectoryToPath;
flagsField.SetValue(knownMethod, flags);
}
}
http://support.microsoft.com/kb/2134299
answered Nov 6, 2013 at 21:58
Taras KravetsTaras Kravets
1,3534 gold badges13 silver badges15 bronze badges
- Remove From My Forums
-
Вопрос
-
Здравствуйте.
Подскажите пожалуйста как справиться с этим командлетом Remove-FTPItem
Мне надо чтоб он удалял только файлы и не затрагивал папки в которых надо удалить файлы, а по описанию я так понял он при удаление файлов затронет и папки 🙁
Ответы
-
Протестировал, все отрабатывает, как надо.
$ftpServer = "ftp://ftpserver.org" $username = "Login" $password = ConvertTo-SecureString 'Password' -Force -AsPlainText $FtpPath = "/Report/31/" $File = "*.zip" $credentials = New-Object System.Management.Automation.PSCredential($username, $password) Set-FTPConnection -Credentials $credentials -Server ftp://ftpserver.org -Session ftpServerS -UsePassive $Session = Get-FTPConnection -Session ftpServerS Get-FTPChildItem -path $FtpPath | Get-FTPItem -localpath $FullPath -Verbose Get-FTPChildItem -Session $Session -Path $FtpPath -Recurse | Where {$_.Dir -ne "dir" -and $_.Name -like "$File*"} | Remove-FTPItem -Session $SessionРезультат:
PS > Get-FTPChildItem -Session $Session -Path $FtpPath -Recurse | Where {$_.dir -ne "dir" -and $_. Name -like "$file*"} Parent: ftp://10.0.0.1/Report/31 Dir Right Ln User Group Size ModifiedDate Name --- ----- -- ---- ----- ---- ------------ ---- - 0B 06-13-13 01:51AM 1.zip - 0B 06-13-13 01:51AM 3.zip Parent: ftp://10.0.0.1/Report/31/123 Dir Right Ln User Group Size ModifiedDate Name --- ----- -- ---- ----- ---- ------------ ---- - 0B 06-13-13 02:19AM d.zip PS > Get-FTPChildItem -Session $Session -Path $FtpPath -Recurse | Where {$_.Dir -ne "dir" -and $_. Name -like "$File*"} | Remove-FTPItem -Session $Session ->Remove File: ftp://10.0.0.1/Report/31/1.zip 250 DELE command successful. ->Remove File: ftp://10.0.0.1/Report/31/3.zip 250 DELE command successful. ->Remove File: ftp://10.0.0.1/Report/31/123/d.zip 250 DELE command successful. PS > Get-FTPChildItem -Session $Session -Path $FtpPath -Recurse | Where {$_.dir -ne "dir" -and $_. Name -like "$file*"} PS > Get-FTPChildItem -Session $Session -Path $FtpPath -Recurse Parent: ftp://10.0.0.1/Report/31 Dir Right Ln User Group Size ModifiedDate Name --- ----- -- ---- ----- ---- ------------ ---- DIR 06-13-13 02:25AM 123-
Помечено в качестве ответа
13 июня 2013 г. 10:14
-
Помечено в качестве ответа
