Sorry for a 3rd reply, but just to confirm my code all works fine when the image to be uploaded is a static file uploaded with my app, including if the image is in a subfolder. So it appears curl only has a problem with files on vfs:// or gfs:// (unfortunately this is critical to my app as I need somewhere to store temp files momentarily...)
Thanks On Sunday, July 5, 2015 at 4:23:35 PM UTC+1, Stuart Langley wrote: > > Files that you write to vfs are removed at the end of the request. If you > need the files to persist between requests you'll need to write or move the > files from vfs to gs. > > On Sunday, 5 July 2015 04:04:11 UTC+10, Alex Kerr wrote: >> >> Hi, >> >> I've got my main PHP script writing an image file out to vfs:// using the >> PHP GD lib function imagepng(image, filename) >> >> Then I'm using Facebook's PHP SDK to try and post that. FB's SDK uses >> Curl internally to read the file, so I simply supply the vfs:// filename to >> it. I then get back an error saying it can't open the file: >> >> PHP Fatal error: Uncaught exception 'Facebook\FacebookSDKException' with >> message 'couldn't open file "vfs://root/temp/T199952197c"' in >> /base/data/home/apps/s~My-App-ID/1.385481947954511984/fb/src/Facebook/HttpClients/FacebookCurlHttpClient.php:150 >> >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Ffb%2Fsrc%2FFacebook%2FHttpClients%2FFacebookCurlHttpClient.php&line=150> >> >> Stack trace: #0 /base/data/home/apps/s~ >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Ffb%2Fsrc%2FFacebook%2FFacebookRequest.php&line=260> >> My-App-ID >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Ffb%2Fsrc%2FFacebook%2FHttpClients%2FFacebookCurlHttpClient.php&line=150> >> /1.385481947954511984/fb/src/Facebook/FacebookRequest.php(260) >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Ffb%2Fsrc%2FFacebook%2FFacebookRequest.php&line=260> >> : Facebook\HttpClients\FacebookCurlHttpClient->send('https://graph.f...', >> 'POST', Array) >> #1 /base/data/home/apps/s~ >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Fpost.php&line=188> >> My-App-ID >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Ffb%2Fsrc%2FFacebook%2FHttpClients%2FFacebookCurlHttpClient.php&line=150> >> /1.385481947954511984/post.php(188) >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Fpost.php&line=188> >> : Facebook\FacebookRequest->execute() >> #2 {main} thrown in /base/data/home/apps/s~ >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Ffb%2Fsrc%2FFacebook%2FHttpClients%2FFacebookCurlHttpClient.php&line=150> >> My-App-ID >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Ffb%2Fsrc%2FFacebook%2FHttpClients%2FFacebookCurlHttpClient.php&line=150>/1.385481947954511984/fb/src/Facebook/HttpClients/FacebookCurlHttpClient.php >> >> on line 150 >> <https://console.developers.google.com/project/richerposts/clouddev/source/resolve_location?appModule=default&appVersion=1×tampNanos=1436032217899000000&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~richerposts%2F1.385481947954511984%2Ffb%2Fsrc%2FFacebook%2FHttpClients%2FFacebookCurlHttpClient.php&line=150> >> >> My first thought was a permissions issue (i.e. FB script not allowed to >> read file my script created), but checking permissions of my image file in >> vfs:// - they are set to 0666 and I've tried changing them to both 0644 and >> 0777 (and confirming they are set) and still get the error... >> >> Any ideas please? >> >> Many thanks! >> Alex >> > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/037f9513-39c5-4768-a376-7638629da788%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
