mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 07:02:09 +01:00
146 lines
3.9 KiB
XML
146 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 4d1c34c9b7a30cfc3a59641122c707a2812cfed7 Maintainer: leonardolara Status: ready -->
|
|
<refentry xml:id="function.ftp-alloc" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>ftp_alloc</refname>
|
|
<refpurpose>Aloca espaço para um arquivo ser carregado</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>ftp_alloc</methodname>
|
|
<methodparam><type>FTP\Connection</type><parameter>ftp</parameter></methodparam>
|
|
<methodparam><type>int</type><parameter>size</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter role="reference">response</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Envia um comando <literal>ALLO</literal> ao servidor FTP remoto para
|
|
alocar espaço para o envio de um arquivo.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Muitos servidores FTP não suportam este comando. Esses servidores podem retornar um código
|
|
de falha (&false;) indicando que o comando não é suportado ou um código de sucesso (&true;)
|
|
para indicar que a pré-alocação não é necessária e o cliente deve continuar
|
|
como se a operação tivesse sido bem-sucedida. Por causa disso, talvez seja melhor reservar
|
|
esta função para servidores que exijam pré-alocação explícita.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>ftp</parameter></term>
|
|
<listitem>
|
|
&ftp.parameter.ftp;
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>size</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O número de bytes a serem alocados.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>response</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Uma representação textual da resposta do servidor será retornada por
|
|
referência em <parameter>response</parameter> se uma variável for fornecida.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
&ftp.changelog.ftp-param;
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemplo de <function>ftp_alloc</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$file = "/home/user/myfile";
|
|
|
|
// conectando ao servidor
|
|
$ftp = ftp_connect('ftp.example.com');
|
|
$login_result = ftp_login($ftp, 'anonymous', 'user@example.com');
|
|
|
|
if (ftp_alloc($ftp, filesize($file), $result)) {
|
|
echo "Espaço no servidor alocado com sucesso. Enviando $file.\n";
|
|
ftp_put($ftp, '/incoming/myfile', $file, FTP_BINARY);
|
|
} else {
|
|
echo "Não foi possível alocar espaço no servidor. Informação do servidor: $result\n";
|
|
}
|
|
|
|
ftp_close($ftp);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>ftp_put</function></member>
|
|
<member><function>ftp_fput</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|