1
I’ve been trying to find a solution to my problem for at least two weeks and I can’t make it work. The idea is, I have an application Windows Forms
written in C#
, in which I will have a OpenFileDialog
which will select the path to an image .png or .jpg in the customer’s computer, and selected this path, when I click record, the image needs to be renamed (may be for date of day), and then sent to a service at PHP
as in the example below:
<?php
if(isset($_FILES['fileUpload']))
{
//Pegando extensão do arquivo
$ext = strtolower(substr($_FILES['fileUpload']['name'],-4));
$name = $_FILES['fileUpload']['name'];
$dir = './upload/'; //Diretório para uploads
//Fazer upload do arquivo
move_uploaded_file($_FILES['fileUpload']['tmp_name'], $dir.$name);
echo("Imagen enviada com sucesso!");
}
Basically the idea is to upload images using C#
(from an application Windows Forms
) on the customer’s side and send this to the PHP
(or directly to the destination directory on the server).
The problem here is basically:
Grab the image
->
rename the image->
send to folderuploads
on the server.
Observing: the image has to be renamed before it is sent to the server, since I associate the static name of the image with a record in the database to later fetch the image.
Perfect! Thank you! You helped me out more with this, thank you very much!
– João Regis