Filepicker.io storeUrl mimetype - filepicker.io

There doesn't seem to be a mimetype for storeUrl; the default also seems to be octet-stream; how do I convert this to image/png or some image? I tried filepicker.convert, but got back a 142 error.
P.S. Putting in debug mode, I get this url:
https://developers.filepicker.io/answers/jsErrors/142
Not very helpful :/ I figure this is in your pipeline though.
Thanks!

Related

Serving local images with Play 2 to be displayed inline

Earlier I asked how to serve a local image here: Serving local images with Play 2 / Scala
This works well, except that the image is forced to download by the browser, instead of being displayed in the browser.
I have added "inline = true" argument to OK.sendFile, as described here: http://www.playframework.com/documentation/2.2.x/ScalaStream , but that doesn't seem to work, the image is still being downloaded. It seems that Content Type is not getting recognized? Play documentation says it should automatically set it using the file extension, so not sure what's going. Help?
EDIT: Response header example:
HTTP/1.1 200 OK
Content-Length:2694220
Content-Type: application/octet-stream
Looking through Play's code, I realized I could simply add .withHeaders onto sendFile:
Ok.sendFile(content = new java.io.File("filepath"), inline = true).withHeaders(CONTENT_TYPE -> "image/jpeg")
This solved the problem! Thanks #biesior for the pointer.

Provided og:image is not big enough in Facebook linter

I properly set og:image on my website, the facebook linter sees it (facebook debugger) however, it says the image should be at least 200x200, which it is not the case, my image is 250x250 image.
What could be causing the issue? Could this have anything to do with Cloudfront?
Edit: I got around it by switching from this image to another image which is a
jpg image, but still I couldn't find the cause for the problem since the image
looks fine.
This was happening to me. I was only using the meta og:image tag. I added the following in the head
<link rel="image_src" type="image/jpeg" href="img_path" />
and it fixed the problem for me.
The thread here is pretty helpful: og:image Open Graph Warnings image size
Generally, FB's parser prefers images that are (1) measured in multiples of 100 and (2) square format.
I have experienced same error with my custom Web server ServeRick, the solution unexpectedly was to send Content-Length header with images.. without this header facebook didn't accept any of my og:image links
I was having a space in my image path of my image.
Like my image path was http://example.com/jodha akbar/image.jpg
If you observe above. The jodha akbar directory is having space.
And Facebook was not picking up the path due this special character may be.
I added a PHP str_replace function. And it worked for me.
str_replace(" ","%20",$image_path)
Converting the same image from JPG to PNG did the work for me.

Filepicker.io pick epub mimetype

I've been working with the filepicker api for the past day or so - trying to wrap my head around mimetype validation when using the pick method. I'd like to only support uploading epub files, which have the mimetype : 'application/epub+zip'. However, whenever I use this as the only supported mimetype in filepicker, I get the following error :
The page can only support a application/epub zip/*
It seems to be interpreting the '+' inside of the string as a space. Any advice on how to fix this, or validate epub files properly would be appreciated!
Edit : I found a way around this by using 'extension' instead - and adding {extension : '.epub'}. This will work, as I can just set the maxSize to be some reasonable number, and perform some validation server-side (and deleting the file from s3 if it isn't actually an epub). If someone figures out how to do it properly with the mimetype that would be awesome though!
Glad you got it to work with extension, one way with mimetype might be to urlencode the + to be %2B

WebView doesn't load my HTML String in iPhone

This doesn't load my HTML string in the WebView.
NSString *htmlString = #"<html><body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>";
//I have a very large HTML content here.. For sample I have given a small content
[teaserWebView loadHTMLString:htmlString baseURL:nil];
Do I need to use some encoding? Any help will be appreciated.
Thanks
Edit: Solution found in comments on question.
In your large HTML, Replace % with %25.
I really don't know if that will help, but it is required in Android WebView. All encoding is automatic except it does not know whether or not to encode %.
There is a better way to encode everything, but it is not required and I have no clue how to do it in iPhone.
See this page for more info: http://www.w3schools.com/TAGS/ref_urlencode.asp
Also you may want to look up "URL Encode iPhone".
I know this is not a URL, but in Android it gets converted to a data: URL where all the data is in the URL. It likely works the same way in iPhone.

iPhone: XML Parsing Problem?

I have some XML that looks like the following sample:
<INLINE>
<IMG LINKTEXT="خدمات ديني يقيني" NUMOFCOLOUMNS="9" NUMOFROWS="20">RamadanPortal</IMG>
</INLINE>
When I tried to parse the above XML using NSXMLParser, I'm getting the LINKTEXT response as U062e\U062f.
How can I get the exact Arabic text instead of Unicode characters? Thanks in advance.
You need to download the file in the correct encoding. There's plenty of documentation on this on the apple website (developer docs), but since you haven't supplied a code example I can't point you at the exact one.