I’m writing a DLL in C# and I’m making a reference to this VB assembly. After combing the internet I could not find how this function works on the server-side. How would you write a PHP script to receive the file uploaded by this function? Does it $_POST it or $_FILE it?
Edit: I followed Adnan’s advice and var_dumped $_POST, $_FILE, $_REQUEST, and php://input. All come up with nothing useful. Even with a blank file, the name isn’t coming through.
Here is the DLL’s code for this function. I have a download function that works the same way.
public object UploadFile(string ToPath, string FromPath)
{
try
{
MyProject.Computer.Network.UploadFile(FromPath, ToPath);
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
ProjectData.ClearProjectError();
}
return null;
}
Network.Uploadfile uses WebClient.UploadFileAsync internally with a POST-request (unless you specify a ftp-server as target address). Looking a bit deeper (using ILSpy) it seems to create a complete “multipart/form-data”-request (i.e. the same as if you put file upload in a html form) so it should be available in $_FILE (isn’t it $_FILES?).