Пример #1
0
        protected override MultipartData GetRequestData(TypedData data)
        {
            var builder = new MultipartDataBuilder();
            builder.File((Stream) data.Data, "upload", data.Name);
            builder.KeyValuePairs(new Dictionary<string, string> {
                // FIXME Remove and adjust as required.  Just copy-pasted all
                // this from the main page.  (Don't shoot me.)
                { "mode", "local" },
                { "formurl", "http://www.postimage.org/" },
                { "tpl", "." },
                { "addform", "" },
                { "mforum", "" },
                { "um", "image" },
                { "adult", IsAdult ? "yes" : "no" },
                { "ui", "" },
                { "hash", "943" },
                { "optsize", "0" },
                { "submit", "Upload It!" },
            });

            return builder.GetData();
        }
Пример #2
0
        protected override MultipartData GetRequestData(TypedData data)
        {
            var builder = new MultipartDataBuilder();
            builder.KeyValuePairs(new Dictionary<string, string> {
                { "raw_paste", data.Data.ToString() },
                { "comment", "" },
                { "author", Author ?? "" },
                { "language", Language ?? "text" },
                { "permissions", IsPrivate ? "1" : "0" },
                { "desc", data.Name ?? "" },
                { "linenumbers", ShowLineNumbers ? "0" : "1" },
                { "expire", Expiration.TotalSeconds.ToString(NumberFormatInfo.InvariantInfo) },
                { "submit", "Submit Paste" },
                { "tabbing", "true" },
                { "tabtype", "real" },
            });

            return builder.GetData();
        }
Пример #3
0
        protected override MultipartData GetRequestData(TypedData data)
        {
            var builder = new MultipartDataBuilder();
            builder.File((Stream) data.Data, "f", data.Name);
            builder.KeyValuePairs(new Dictionary<string, string> {
                { "t", "file" },
                { "name", data.Name ?? "" },
                { "tags", Tags ?? "" },
                { "description", Description ?? "" },
                { "adult", IsPrivate ? "t" : "f" },
                { "sfile", "Upload" },
                { "url", "" },
            });

            return builder.GetData();
        }