CodeIgniter video files not uploading on web server - facebook

I have created a codeigniter application with a file upload feature. This is loaded as my Facebook app in a Canvas page. I have set my allowed types as png,jpg, mp4.
When tested on localhost this works fine and uploads well.
However, when uploaded on my server and installed as my canvas app, when I access my page via apps.facebook.com/myapp, the images are uploaded fine, BUT, when I try to upload a mp4 file, thatwas successfully uploaded on localhost version, it returns the upload error "The filetype you are attempting to upload is not allowed.".
But I have set it as an allowed type.
I tried uploading via the canvas url (www.myapps.com/apps) rather than the canvas page (apps.facebook.com/myapp), but it gives the same problem, it says the type is not allowed.
I thought it might be server not configured so I add AddType video/mp4 .mp4 to the server's and app folder's .htaccess.
Also I made sure that mp4 is added in the mime.php in my codeigniter app.
Just not sure what to do again. It keeps saying it's not allowed, but it is.
Any help would be great. How do I fix this?

Try adding the both mime types in the list in the config folder for codeigniter. Like this.
'mp4' => array('video/mp4', 'application/octet-stream')

Related

TWA bases app sometime showing URL and sometime working, even Assetlink.json uploaded properly

I have website (https://www.kriscent.com/product/kart-supermarket/). I created PWA of that after that I uploaded it on Play store by using TWA(Trusted Web Activities), App URL is https://play.google.com/store/apps/details?id=in.kriscent.kartlite.
The URL of website always show in app, So I uploaded the assetlink.json (URL: https://www.kriscent.com/.well-known/assetlinks.json).
After uploading the assetlinks.json, When I run my app, the website URL disappeared but when I switched on other link in the app then the URL shows again.
I don,t know what is happening. Please help me if anybody has idea to resolve this issue.
enter image description here
enter image description here
The problem is that, when navigating to a product detail page, you are using a different origin than the one used to open the Trusted Web Activity and that doesn't have Digital Asset Links setup:
When the application is started, it opens https://www.kriscent.com/, which is correctly validated.
When clicking on a product, the user is take to https://kriscent.com/ (without www), which is a different origin, and is not validated in the Android app.
It is possible to get the Trusted Web Activity to work with multiple origins but, in this case, I'd recommend using a single origin for the initial URL and the navigations, as you will be able to take advantage of using the same service worker, browser storage, etc.

pdf download not working on Android with cordova inappbrowser

In my cordova inappbrowser app, pdfs can be downloaded by calling a RESTful service that streams the content to the user's browser (see html snippet below). This works fine on iOS and using Google Chrome directly on Android but not when doing it through cordova inappbrowser. Clicking on the link doesn't do anything. I've tried many of the suggestions here including using gview but no result.
The tag in html is an href (I tried using window.open as well) that evaluates to something like https://xxx/member/get_pdf/217521359ashr868af6as. Using target='_blank' (tried _system also)
where the value after get_pdf is a guid (value above is not the real guid)
The google viewer workoaround that many people propose works fine with a physical pdfs but my files are streamed back from the service above and gview doesn't recognize it as a pdf and shows error 'preview not available' and its not an option to store them physically. Is there some specific header to set to make gview recognize the streamed response as a pdf? I set content_type, Content-length, tried adding Content-disposition with a filename also. No go.
Any suggestions appreciated.
Thanks,
Patrick

Where must I upload my .unity3d

Ok the problem is when I try to put my "Unity Binary URL" to facebook's developers web page, it shows me an error message saying that my url must ends with .unity3d...
I try to upload it to... MEGA, Drive, OneDrive, DropBox and all of them give me a encripted url like this:
.../open?id=0B9ZOtq4g8KlZNXc5cndQcEY1RVE&authuser=0
(this project is already shared in public)
My Question is... where or how must I upload this file for get the correct url?
I mean .../myfolder/myfile.unity3d ???
for Google Drive youll get a link like this when you hit the share button and make sure its the share link to the WebPlayer folder
https://drive.google.com/folderview?id=0B8mGQfidoAhjeFFiWC1r97s1SlE&usp=sharing
so the real key to this is after the id= part this
0B8mGQfidoAhjeFFiWC1r97s1SlE
you take that key and put it into facebook like this
https://googledrive.com/host/0B8mGQfidoAhjeFFiWC1r97s1SlE/WebPlayer.unity3d

Upload a hosted image with Facebook's Graph API by url?

So, I'm using the Facebook Graph API to upload a photo. Using curl, it goes something like this:
curl -F 'access_token={some access token}'
-F 'source=#/some/file/path/foo.png'
-F 'message=This is a test of programatic image uploading'
https://graph.facebook.com/me/photos
Now, this works fine if I have the file on the machine I'm making the request from. The issue is that the system I'm working on gets the image as a url (say, "http://example.com/foo.png"). I'd rather not download the image from example.com to my server just to upload it to facebook, since I have no need to keep it other than that. Is there any way I can just pass the url to facebook, or is this impossible?
(-F 'source=#http://example.com/foo.png' does not work)
In the past, we've simply downloaded the file locally to the server, then handled the upload and unlinked it. This way we're also able to be sure that the asset was available (servers/connections flaking out) to be uploaded in the first place. I don't believe you can initiate an upload and the media to come from a third-party (may be wrong though).

Using HTML from bundle to save cookies in UIWebView?

So I have a web page inside my bundle, which I load in a UIWebView. However, the page doesn't seem to be able to store any cookies, even though other (online) websites can. How do I get it to store my cookies?
I don't think you can. Cookies are connected to a specific site and path. That does not map well to documents served from disk.
I don't really see a simple fix for this. One thing you could try is to embed a little web server in your app and then use it to serve that content on localhost.
You can. I load an html file from my bundle and it saves cookies fine and I reload those cookies next time it starts up no problems. They are in the CookieStorage. If you dump out all the cookies in there for your app you should find any cookies your application saved.
even if you have trouble getting your webapp to save the cookies you could always explicitly retrieve the cookies via javascript and in obj-c code save the returned data into cookiestorage. Some tips on using cookiestorage...http://blog.andrewpaulsimmons.com/2008/08/add-set-and-delete-cookies-in-uiwebview.html