-
Posts
1,041 -
Joined
-
Last visited
-
Days Won
17
Everything posted by gw1500se
-
but it ??????
-
You asked what the problem may be. That is my answer based on the code, details and error messages you posted.
-
Postfix configuration.
-
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
The successful download acknowledgement can trigger the delete on the server. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
How can you know the download was successful before the download completes? -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
My bad. It has been a while since I did this. Your previous code is correct as is the image you posted of the result. Sorry. So where are you stuck now? -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
I'm not sure why what I gave you is not working. I'd have to see all the code. What you posted looks correct. So what is the problem with that? -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
Did you initialize the array like I showed? $send=[]; And did you use +=? -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
There you go. Just JSON decode it in c++. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
Not quite. That will create a JSON array with the name and size as separate entries. You want each name to be associated with its specific size so create an array of arrays. $send=[]; foreach ($files as $key => $val) { $send+=array('Name'=>basename($val),'Size'=>filesize($val)); } Then on the c++ side you will have an array of n entries where each entry contains an array with the key 'name' and 'size' with their respective values. -
echo "<pre>"; var_dump(getallheaders()); echo "</pre>";
-
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
Use curl to activate a PHP script that deletes the file. Here is where you will need some kind of security. Perhaps send the file name in an encrypted string that only the server can decrypt. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
That is a JSON string. Cereal will do what you want in c++. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
You can't. You need to take the output from the PHP script and process it into an array in c++. What format did you choose to return in the PHP script? If JSON then you need to use c++ json decode to convert it to an array. -
CURL PHP Crawler Returns Access Denied Error
gw1500se replied to Geoffism00's topic in PHP Coding Help
How about making your script readable? Use the code icon (<>) and select PHP. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
"http://localhost//Download//info.txt" needs to be the PHP script that returns any files ready for download. You did not post the code where you read the result from the curl_easy_perform. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
Your questions seem to be going in circles. Lets back up and and tell us how you are using curl in your c++ program. I assume you are using the c++ curl library, right? -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
Echo means that information, as a string, will be collected by the issuing curl command. That is the whole point of curl get. The format you use (JSON, XML, comma delimited) is up to you when you echo the names. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
You're kidding, right? Try 'echo'. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
When your client contacts the server, have the PHP script return the names of any files that are ready to download. Then have the client request the download of those files. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
So what are you asking of us? -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
This is a help forum not a free coding forum, if that is what you are asking. You need to do the work and if you have problems, show what you did, what you expect and what is wrong. A summary of what you want is to write a PHP script that is launched by the client via curl. That script would then check the directory for a file(s) and if present start the download. Once complete the client would confirm the successful download and have the PHP script delete the file. -
upload files from php server to c++ client using curl
gw1500se replied to jazz15's topic in PHP Coding Help
You will need to turn your thinking around. You need the client to periodically query the server and have the server tell the client if there is a file to download. Then the client can download the file from the server and when complete the server can delete the file. -
You need to learn to use these functions. Notice how unreadable your output is. If you RTFM you would see that var_dump outputs a structured format. Try again with: echo "<pre>"; var_dump($return); echo "</pre>";
-
Do a 'var_dump($return)' to see exactly how the decode structures the return array. From that you will see what your error is. As a hint, your foreach statement should look more like: foreach ($return as $key=>$val) {