Problem with some characters in the filename

71 views
Skip to first unread message

IanBrown

unread,
Aug 1, 2010, 6:55:54 AM8/1/10
to Google Data APIs .NET Client Library
Hi!

Are there any restrictions on a name of the file to be uploaded? I've
caught
"System.ArgumentException: Specified value has invalid Control
characters" trying to to upload one Chinese video. In particular, the
problem is raised if "世" symbol presents (sorry don't know for sure
what does it mean). No problem with other eastern language symbols. Is
it a bug or a restriction?

Ian
Message has been deleted

Chetan Raiyani

unread,
Aug 2, 2010, 8:24:48 AM8/2/10
to Google Data APIs .NET Client Library
Hi,

Try to pass your "title" by using Encodinig.UTF8.GetBytes("Title");
I hope, it will work for you...

Tell me if it is working properly...
------------
Chetan Raiyani

IanBrown

unread,
Aug 4, 2010, 3:53:29 AM8/4/10
to Google Data APIs .NET Client Library
Hi Chetan!

Sincere thanks for your reply!
Some details to clarify the situation. The problem isn't in my
particular implementation as I thought at first. The same error occurs
in the Google SDK YouTubeUploader (if the file name contains "世").
As a workaround is concerned. There is some difficulty in
straightforward implementation of your advice in my case. I use
ResumableUpload component and have the following code:
Google.YouTube.Video v = new Video();
v.MediaSource = new MediaFileSource("C:\世test.flv");

Ian

IanBrown

unread,
Aug 4, 2010, 5:22:59 AM8/4/10
to Google Data APIs .NET Client Library
One more 'problematic' symbol - "清". Files containing these characters
_can_ be uploaded via browser, but not using .NET GData client
library.
The exact error looks like that:
System.ArgumentException: Specified value has invalid Control
characters. Parameter name: value
at System.Net.WebHeaderCollection.CheckBadChars(String name,
Boolean isHeaderValue)
at System.Net.WebHeaderCollection.Add(String header)
at
Google.GData.Client.ResumableUpload.ResumableUploader.PrepareRequest(Uri
target, String slug, String contentType, Int64 contentLength)
Message has been deleted

Chetan Raiyani

unread,
Aug 4, 2010, 1:30:34 PM8/4/10
to Google Data APIs .NET Client Library
Hi Ian,

I found something which might be help you.
See the developer's guid :
http://code.google.com/apis/youtube/2.0/developers_guide_dotnet.html
//----------------------------------------------
Google.YouTube.Video v = new Video();
v.Title
=Encodinig.UTF8.GetBytes(Path.GetFileNameWithoutExtension("C:\世
test.flv"));
v.MediaSource = new MediaFileSource("C:\世test.flv");
Video createdVideo = request.Upload(v);
//----------------------------------------------
Let me know whether it is working or not after applying this change.

Ragads,
---------------------
Chetan Raiyani
Mumbai
Reply all
Reply to author
Forward
0 new messages