1

Web API Web サービスで base64 文字列 (画像) を受信しようとしています。

私が抱えている問題は、文字列の長さにあります。受信文字列の制限を設定して、巨大なサイズの文字列を許可する方法はありますか? 文字列は、URL で使用するために既にエンコードされています。私が言えることから、これは私の問題です。現在、関数を呼び出すと、404 エラーが発生します。ただし、base64string を削除して通常の文字列だけを挿入すると機能します。

これが私の機能です

    public int userLogin(string identifier, string name, string hometown, string photo)
    {
        da = new SqlDataAdapter();
        ds = new DataSet();
        command = new SqlCommand("p_userLogin", connection);
        command.Parameters.AddWithValue("@userInfo", identifier);
        command.Parameters.AddWithValue("@name", name);
        command.Parameters.AddWithValue("@hometown", hometown);
        command.Parameters.AddWithValue("@photo", photo);
        command.CommandType = CommandType.StoredProcedure;
        da.SelectCommand = command;
        da.Fill(ds);
        int userID = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
        return userID;
    }

そして、これは私が送信しようとしているベース64文字列です

%2F9j%2F4AAQSkZJRgABAgAAAQABAAD%2F%2FgAEKgD%2F4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA%2FAAAAF5jcHJ0AAABXAAAAAt3dHB0AAABaAAAABRia3B0AAABfAAAABRyWFlaAAABkAAAABRnWFlaAAABpAAAABRiWFlaAAABuAAAABRyVFJDAAABzAAAAEBnVFJDAAABzAAAAEBiVFJDAAABzAAAAEBkZXNjAAAAAAAAAANjMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAEZCAABYWVogAAAAAAAA9tYAAQAAAADTLVhZWi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F2gAMAwAAARECEQAAEP8AnYN%2BoCoX5k0IxmM%2F7BlVolzfNjP%2FxAAaEQEAAwEBAQAAAAAAAAAAAAABABEhEDEg%2F9oACAECEQE%2FEIPAUuBY%2BKjAXA0imzXztyoRE7MjwdTJdTJMqIOS%2Bf%2FEACARAAIABQUBAAAAAAAAAAAAAAABEBEhMeEgcZGh8EH%2F2gAIAQERAT8QiwRp1hKLsOqYregkJ%2FsCnMbIlBeeQ6bd4HMt7gSlt3g294Ni5wf%2FxAAnEAEAAgIABgICAgMAAAAAAAABABEhMUFRYXGBkRDwIKGxwdHh8f%2FaAAgBAAABPxD8bHBvyAtgSxubWaeyjq3OWmhRcWa5BGuE702QdPYj5fh%2BWLBlL3GAokoQq7dXgYYJuyUWKCqNrMBct19ib7rYxnGmY9RPIjrFx7qNJlNYUH8x%2FB3OmW8%2FjJkUoBss3jSnmAoWwqwwvHHq6hStcYl5NWiZyjeWGrZBwArVeX3DtqbgEUuQIPEflgkW35Ciyo7Zf1cIFq8yPv8AzGvE029aczugohlJgKoQa78%2FEfik06SiWQbYMy7BGLHsHL4gMPQBHKEsC1PEqUcDUxvtcBUBzdDnAkkL4UwK4bOJu%2Be%2Fhm0Uxt5VHo3t5%2B2IQxVlnJLe4J1imuUmbyK8C%2BssiZbu8VuFIDhX79QPiMEE2tf8QNTVZsL61sHKznGcZ7JWSigchks6B6VCjzgL6NBh8RtB77jjuODlgMIAlDSf1cGoiTwUbXGsNrdpqgAKcRoBCmkrYDTV3DM1O5T2Fd25g4SuNI9OxqACkmq5A4jCbarwqbiXHdl%2Fo8RcALYRTkcwgTUNq9x3BYURVZikFM1dPgiGZ1v%2FAHxRft94XAh3ojx6zGRwwGliiTcA5LTESZAtbwDiXeAq%2FwC8QFpj75gF%2Bn5hS%2Bn5n%2F%2FZ

これに関するご意見をいただければ幸いです。

4

1 に答える 1