Exemple #1
0
        public string Upload(ref string filePath, ref string message, long replyTo)
        {
            if (string.IsNullOrEmpty(filePath))
            {
                return("Err:File isn't specified.");
            }

            if (string.IsNullOrEmpty(message))
            {
                message = string.Empty;
            }

            FileInfo mediaFile;

            try
            {
                mediaFile = new FileInfo(filePath);
            }
            catch (NotSupportedException ex)
            {
                return("Err:" + ex.Message);
            }

            if (!mediaFile.Exists)
            {
                return("Err:File isn't exists.");
            }

            if (MyCommon.IsAnimatedGif(filePath))
            {
                return("Err:Don't support animatedGIF.");
            }

            return(_tw.PostStatusWithMedia(message, replyTo, mediaFile));
        }
Exemple #2
0
        private bool IsValidIconFile(FileInfo fileInfo)
        {
            string ext = fileInfo.Extension.ToLower();

            return(IsValidExtension(ext) && fileInfo.Length < 700 * 1024 && !MyCommon.IsAnimatedGif(fileInfo.FullName));
        }