Closed GoogleCodeExporter closed 9 years ago
As a workaround you can use "Text uploader: File uploader" with "File uploader:
Custom file uploader" so you can use post upload like this.
Original comment by flexy...@gmail.com
on 7 Feb 2013 at 5:40
Ah, that's a good point, although a more 'official' feature would be much
appreciated. Using the workaround would require creating a file first, right,
rather than taking the text from the clipboard?
Original comment by computer...@gmail.com
on 7 Feb 2013 at 5:51
It not creating file, it using memory stream. Because every single text
uploader api i used works with get method, i made class according to this so i
can't do what you want.
Original comment by flexy...@gmail.com
on 7 Feb 2013 at 5:53
Right, but the Text Uploader->File Uploader->Custom File Uploader route would
require that I create a file first, no?
Original comment by computer...@gmail.com
on 7 Feb 2013 at 5:59
No it don't require file.
Original comment by flexy...@gmail.com
on 7 Feb 2013 at 6:00
Me being me, I decided to see if I could implement my request myself. Attached
is a patch file containing the changes I have made (which can be opened in a
text editor. The important part is at line 715; everything before is generated
UI code change), which are:
1) When POST request method is selected and a file form name is supplied for
custom text uploaders, the input is uploaded as a file rather than an argument
in the URI.
2) Small UI tweaks and tooltip update - below is the rewritten text for the
request method [?] box, I couldn't get the newlines to work.
--
For image & file uploads, the 'POST' request type is required along with the
'File form name.'
For text & url shorteners, both request types are usable: if using the POST
method, entering a
File Form Name will upload the input as a file (useful for very long inputs),
while leaving
FileFormName blank will act like GET, where you need to use '%input' for an
argument value.
For example, if the argument name is 'pastebin_text' then a value of %input
will be automatically
replaced with the text you're going to upload. Same thing applies for url
shortener; '%input'
will be replaced with the url in the argument.
--
Hope to see at least some of this added in if you like it.
Original comment by computer...@gmail.com
on 8 Feb 2013 at 6:58
Attachments:
Why i can't use post in text uploader is because haven't filename to use.
Therefore you used "text.txt" so all text uploads will have same filename which
is not acceptable.
Original comment by flexy...@gmail.com
on 8 Feb 2013 at 2:32
What do you use for the name of an image? Settings->Upload->General->"Name
Pattern for capture or clipboard upload:", right? Is there any reason to not
use that for the text file?
Original comment by computer...@gmail.com
on 8 Feb 2013 at 2:48
Because it is not given to upload method.
Original comment by flexy...@gmail.com
on 8 Feb 2013 at 2:50
What you tried to change in designer.cs because i can only see control size
changes and also tooltip is removed.
Original comment by flexy...@gmail.com
on 8 Feb 2013 at 2:56
Also stream is given to text upload method and it converting to string so after
that again turning it to stream gonna be weird. Because that custom uploader
can work with both string and stream and because of interface i must use only
string parameter it gonna cause problem too. So if it was possible fix with
clean solution i would have did it myself.
Original comment by flexy...@gmail.com
on 8 Feb 2013 at 3:01
Can you fix your tooltip description because im not planning to add filename
support to url shorteners because obviously there is no file.
Original comment by flexy...@gmail.com
on 8 Feb 2013 at 3:44
This issue was closed by revision r299.
Original comment by flexy...@gmail.com
on 8 Feb 2013 at 3:47
Can you test latest commit is text uploader works with GET, POST, POST file
form.
Because i don't have host to test.
Original comment by flexy...@gmail.com
on 8 Feb 2013 at 3:47
Apologies for not replying, was in class.
In the designer, I had added a filename pattern field on the custom uploader
form, but removed it shortly after.
r299 works great, thanks for adding this.
Original comment by computer...@gmail.com
on 8 Feb 2013 at 4:29
Here's a revised tooltip text.
--
For image & file uploads: the 'POST' request type is required along with the
'File form name.'
For text: Specifying POST request type and a File Form Name will upload the
input as a file
(useful for very long inputs).
For text or url shortener: POST with no File Form Name or GET will replace an
argument with
value %input or $input with the text or URL.
For example, if the argument name is 'pastebin_text' then a value of %input
will be automatically
replaced with the text you're going to upload. Same thing applies for url
shortener; '%input'
will be replaced with the url in the argument.
--
Hope that's clear enough.
Original comment by computer...@gmail.com
on 8 Feb 2013 at 4:56
Original issue reported on code.google.com by
computer...@gmail.com
on 7 Feb 2013 at 5:38