How to download image from amezon server base on twilio link? - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 days ago.
Improve this question
I am using twilio to send and received sms and mms.
And in this we get the mms replay from customer and with sms we get image link form twilio, below are the example:
http://media.twiliocdn.com.s3-external-1.amazonaws.com/AC70edf98a96171fd173a06c91f9866e44/7f05c776f706eb9265f74f2236ac146c
And in this we want to download this image on our server. so can any one have any idea how to do this?

I encountered a similar scenario in this blog post where I manipulate a file from the URL as stored by Twilio using my local filesystem before sending it back.
The snippet there in Python:
if request.form['NumMedia'] != '0':
filename = request.form['MessageSid'] + '.jpg'
f = open(filename, 'wb')
f.write(requests.get(request.form['MediaUrl0']).content)
f.close()
I check parameters to make sure that the media is indeed there with NumMedia and I believe in PHP you would use the fopen() function then $_REQUEST[‘MediaUrl0′] to retrieve the image and whatever the PHP equivalent is for binary response content in the python requests library to write the non-text body.
Hope this helps!

Related

scraper with Laravel and Goutte [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Iam going to scraper 4 website using Laravel and Goutte .
number of url(s) are 900 and I don't have any idea, how to send url(s)
(I wrote crawler code and don't have any question about this)
but I don't know How to send url(s)?
Must I use queue or cronJob or ... ?
Do you recognize any package or tool or idea ? I don't have any idea to send 900 urls, 5 times in a day
If you wrote crawl code for websites, you can separate the links and store in CSV format file. You should write another script that enable to read with an exact numbers of these urls in CSV file and send you back. It's very easy in Ruby with open.csv library.

Can I post event photos to Facebook event by website or mobileApp using graph-api 2.7? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
After I read this https://developers.facebook.com/docs/graph-api/reference/event/photos/#Creating I'm not sure that POST request is Upload photo to event or just upload url photo (param "url" in the table) or else ? I try to find any example but still can't find any of it.
As it says there in the description of the url field,
The URL of a photo that is already uploaded to the Internet. You must specify this or a file attachment
The second part means, you can also upload a file (instead of providing a URL). The parameter name for uploads historically has been source – but you can use basically any name, the API doesn’t care. (If you post to a /photos endpoint and the data contains a file upload, then the API will use that, no matter what it is named.)
You can follow this example, https://developers.facebook.com/docs/php/howto/example_upload_photo – that is for an upload to a user profile, but it works the same way for events etc.

How to get file size from file upload services in php [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
How could I get the file size from file upload services like Rapidgator, etc. in PHP?
I tried file_get_contents with regex, but its useless, plus i will have to deal with every website:
mediafire,mega ....
Is there any free API To handle this? (I tried URLCHECKER but its not free)
Thanks.
As far as I'm concerned each file uploading service has its own API for finding file sizes (or possibly no API for doing such a thing).
A service like UrlChecker most likely (to the best of my knowledge) collates the APIs for as many online uploading services as it can find, and will return the file information for each of them in a table for your convenience. You can either pay to leech off their service, or you can design your own, though that will require you to write code to deal with the API for each file uploading service you want to include.
I don't think there is an API for it, but you can always send a request to the service and just read the headers of the response and then close the connection. Nearly all of those download services send a content-length header.

With PHP, Can I POST Directly to Text File? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I know that the usual method for handling a form with PHP is to POST to a script like this:
echo("<form action='handleForm.php' method='post'>");
it possible to POST directly into a text file like this:
echo("<form action='formData.txt' method='post'>");
?
If you want to append the text into the file, it won't.
POST is a type of request to the server to send data. HTTP server will answer with your txt file, and the browser will show that. As the server as default is not able to run any kind of txt codes, nothing will happen. You can set up different codes, how to handle these files.
There are a lot of types of request, read further if you interested in.

recieve file send by client socket using PHP sever socket [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to save file send by client using PHP server socket. I am newbie to PHP socket programming.
Does anyone know possible options?
-SAM
Have look at this snippet, it recieves a file sent to the php socket server then saves it on the server:
http://www.example-code.com/php/socket_receiveFile.asp
Alternatively you could develop your own solution, but then you'd have to:
Create a binary structure for what each request looks like. For example you need to create predefined header that the server can read to know what type of request it is, what type of data it is, where the data starts in the file and what to do with the data.
Create a binary parser which will read the header and which can take the binary data and turn it into a file and then save it.

Categories