file name with special letter(;) does not uploaded - filenames

I'm using Live Connect REST API for uploading file to SkyDrive.
During I tested, file which contains special letter ";" were not uploaded.
below example is what I tested with ;.mp4
PUT https://apis.live.net/v5.0/me/skydrive/files/%3B.mp4?access_token=(access_token)
The response of the request is
BAD_REQUEST(400).
";" letter is not acceptable in Sky Drive?
Please, let me know.
Thanks

The ';' character (%3B) IS a valid OneDrive file name character. Unfortunately it appears as though, for whatever reason, the Live Connect API is not allowing it.

Related

Cloud Storage Transfer "Failed"

I've tried repeatedly to use the Google Developers Console tools to Create a Transfer that works, but haven't had any luck. My source is in S3.
I tried with the "S3://" URL, but when trying to accept the transfer settings, I consistently get "source bucket doesn't exist". I test my URL by placing it in a browser, and I do get it to resolve, so I don't know what's up.
Even more puzzling is when I try using a text file of URLs. These URLs are all http:// strings, and each of them properly loads in a browser. I figured this would be even more straightforward as there are no permissions to be dealt with, really, since each file in the S3 bucket already has read permissions.
Instead, all I get in the Transfer history is "Failed", with no other information at all.
At first, I was greedy and included all my files. When I got nowhere with that, I cut it down to a single file. Still no go.
Here is the text file.
Any clues, por favor?
It looks like your text file doesn't follow the specified format. You should add the header and size/MD5 of each file as described at https://cloud.google.com/storage/transfer/#urls

How to implement XML-safe private Amazon S3 URLs?

On my photography website, I am storing photos on Amazon S3. To actually display them on the website, I am using signed URLs. This means that image URLs expire. Only the web application itself is able to generate valid image file URLs.
An example URL would look like this:
http://media.jungledragon.com/images/1849/21346_small.JPG?AWSAccessKeyId=05GMT0V3GWVNE7GGM1R2&Expires=1411603210&Signature=9MMO3zEXECtvB0w%2FuMEN8obt1ow%3D
Note that by the time you read this, that URL may have already expired. That's ok, the question is about the format.
Whilst the above URL format works fine on the website, it breaks XML files. The reason for this is the & character, which should be escaped.
For example, I'm trying to implement Windows 8.1 live tiles for the website, which you can link to an RSS feed. My RSS feed is here:
http://www.jungledragon.com/all/rss/promoted
That feed will work in most RSS readers, however, the Windows 8 tile builder (http://www.buildmypinnedsite.com/en) is particularly strict about the XML being valid. Here you can see the error it throws on said feed:
http://notifications.buildmypinnedsite.com/?feed=http://www.jungledragon.com/all/rss/promoted&id=1
Now, my simple thinking was to encode the & that are part of the signed URLs, by & or &. Whilst that may make the XML valid, unfortunately S3 does not accept & to be encoded. When used like that, the image will no longer load.
I'm wondering whether I am in a circular problem that cannot be solved?
I have had many similar problems with RSS feeds. XML documents should always use & (or an equivalent like & or &). If a reader is not capable of extracting the URL properly, then the reader is the culprit, not you. But I can tell you that reader programmers will disagree with you.
If you are a programmer, you could fix the problem by having a redirect, but that's a bit of work. So you'd retrieve the URL from S3, save that in your database and create a URL on your website such as http://www.jungledragon.com/images/123 and link the S3 URL with your images/123 page. Now when someone goes to page images/123, you retrieve the URL you saved from your S3 server.
Actually, if the URL http://www.jungledragon.com/images/123 is a reference to your image, you can get the S3 URL at that time and do the redirect on the fly!

Hiding/changing the virtual path in classic ASP

We have a website that requires a username and password. Once logged in, the user can select a link to a PDF in the web browser. Once this has happened they are able to see the full URL path of the PDF, they could copy and paste the path into a different browser without logging in, or send the address to someone else to look at.
I am asking this for a co-worker so I am not too sure on what is needed, but they want to change it from say "documents/customerlist.pdf" to "documents/info.asp" (not sure what the file type should be, maybe just "documents/info"?) I think that is what the goal is. Is this possible? If someone could point me in the right direction we might be able to figure it out!
I should think you can do this in ASP. You'll need to deliver the PDF dynamically via an ASP page, which detects the user's session and only serves the data if they are suitably authenticated (so copying the URL to a different browser/machine will result in a 404 or access denied, as you wish). You'll need to read the data from file and binary-write it to the browser, and set HTTP headers for mime-type, content length etc.
I'd start off with serving it on a pdf.asp?file=customerlist URL, but you can later experiment with changing this to something more readable (docs/customerlist.php). You'll need to look into URL rewriting here.
So, that's the general approach. If you do a web-search around these topics ("ASP serve binary file", "ASP URL rewriting") you are sure to get plenty of examples.

Amazon S3 Prawn PDF

upon adding an image to my prawn document and trying to pull that image from Amazon S3 storage I get the following error
ArgumentError (http://s3.amazonaws.com/briefbucket/photos/2/small/259823_1583726693707_1851950185_973122_7126850_n.jpg?1326839482 not found):
however i looked in my storage folder, the jpg is there. I noticed that the ending file name in prawn is "jpg?1326839482"?
any help would be appreciated.
Alright, I had the same issue today. Now:
I'm using Amazon S3 and loading images uploaded by users. Solution as follows:
if #user.avatar? #in case user didn't upload anything
image open("#{ #user.avatar(:small).to_s.sub!(/\?.+\Z/, '') }")
end
Following
.to_s.sub!(/\?.+\Z/, '')
is used the get rid of all stuff after "?"
Before I have moved to amazon i was not using "open" which was causing the issue.
Let me know if this helps.
I'm not sure I fully understand, but I think you need to URL encode your file name (See encoding).
So your encoded file would be something like:
http://s3.amazonaws.com/briefbucket/photos/2/small/259823_1583726693707_1851950185_973122_7126850_n.jpg%3F1326839482
The ? character is used to designate the beginning of the search path.

Special chars in Amazon S3 keys?

Is it possible to have special characters like åäö in the key? If i urlencode the key before storing it works, but i cant really find a way to access the object. If i write åäö in the url i get access denied (like i get if the object is not found). If i urlencode the url i paste in the browser i get "InvalidURICouldn't parse the specified URI".
Is there some way to do this?
Amazon supports key names with Unicode characters. You do not need to URL encode the key name when you upload a file to Amazon. You do need to URL encode the key name when you generate a download URL.
If you upload a file named åäö.txt to a bucket named mybucket, the download URL will be http://mybucket.s3.amazonaws.com/%C3%A5%C3%A4%C3%B6.txt
If you are using .NET the SprightlySoft S3 Component for .NET has a function to easily generate a download URL and it fully supports special characters in key names. Give it a try at sprightlysoft.com