Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mK1Zi-0005yc-8i for pgsql-general@arkaria.postgresql.org; Sat, 28 Aug 2021 16:52:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mK1Zf-0003hS-0n for pgsql-general@arkaria.postgresql.org; Sat, 28 Aug 2021 16:52:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mK1Zd-0003hK-Pg for pgsql-general@lists.postgresql.org; Sat, 28 Aug 2021 16:52:54 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mK1ZZ-0004ex-LE for pgsql-general@lists.postgresql.org; Sat, 28 Aug 2021 16:52:52 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 062AD5C00B8; Sat, 28 Aug 2021 12:52:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 28 Aug 2021 12:52:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=1 FC0wZDHOtSFKlJYmg830dOGwvKC8k6l2B49nJK8haU=; b=pkQI4PEaoc3pH6SW8 jVMrwHylDkIK+6lRuW8+TQpqVZkLq2krks9Ta61senWIwTRS+v0PaSsXDlnpSDZY oCiikWibMH5EVjC4SWW8OejBaDisfMZj3OU2JC1vCICaMxW0nUjavx6wgqtDd0/g lPE/k5aS+lu1fZQbhosJKyzfynvqVWjohakPchxysjnORNY3ENeP3bhS0LqLJaiZ /wh6oWX8B6cnY5oFRbYqzeXzJuHzk5yg3Zen/USeBX5bRRwqJgBh64IwV3DMAbRg TJ1j7JIwc/f1aI2Sx97fAuBvsy8Ud5YXLxk7T98zOhqtHpr15CTom138JG9D8/UQ KNPeg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=1FC0wZDHOtSFKlJYmg830dOGwvKC8k6l2B49nJK8h aU=; b=XsSknttxvWMqZV0E+EQ5+ZVWXVaEzlqG5JK/tsZZbNpD+zrkAKysv1OCm AH0i+si2Yok1LTncAMAaseGgk9LsQdviYgId6RbSLFuYEmTG80v5HD6GYqDtlUg0 geJzMmSpM0JuYBed059+DxiLo3YtNvYEdywzBLyQ5eLYk6szg1RWbTfLkN1RMmtt 8vPQ0IqGjp4CuUby9inWQCz81n+j98+bKPcvtxFpJSI+i3jbB8dlJvC6sMesD8xu jkDEPlZAwuoSW7TBxs37fQctiM3DCqQNs6Kk5WNKg7eQJMkVgDReROU806upJHen bhqXTZmjKMBhnMROwGLp3UshdGQKw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudduhedguddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesth ekredttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdr khhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeejjedtvd ehveekhefftdduhfdtteehfeetledvjedtfeehjeevudegleejfefhtdenucffohhmrghi nhepphhhphdrnhgvthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Aug 2021 12:52:45 -0400 (EDT) Subject: Re: use fopen unknown resource To: ourdiaspora Cc: "pgsql-general@lists.postgresql.org" References: From: Adrian Klaver Message-ID: Date: Sat, 28 Aug 2021 09:52:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/27/21 3:50 PM, ourdiaspora wrote: > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > > On Friday, August 27th, 2021 at 11:10 PM, Adrian Klaver wrote: > >> https://www.php.net/manual/en/pdo.pgsqlcopyfromfile.php >> > > " > public PDO::pgsqlCopyFromFile( > string $table_name, > string $filename, > " > > Sorry but do not understand; the line does not explain what to write in the php file. I'm not a PHP programmer, but I'm going to say it is filename as described here: https://www.php.net/manual/en/function.fopen.php " filename If filename is of the form ... " > The plan is to write an html file for a user to select a csv file to import into a database. The manual suggests that the file name is already known (e.g. https://www.php.net/manual/en/function.fgetcsv.php) You are asking the user to select a file, so there should be some sort of file reference at that point, correct? Same for below. > > Instead of: > " > ... > fopen("test.csv", "r")) > ... > " > > it would _not_ be possible to write, correct?: > " > ... > fopen("", "r")) > > -- Adrian Klaver adrian.klaver@aklaver.com