GithubHelp home page GithubHelp logo

Custom Uploader improvement about sharex HOT 21 CLOSED

sharex avatar sharex commented on May 18, 2024
Custom Uploader improvement

from sharex.

Comments (21)

Jaex avatar Jaex commented on May 18, 2024

How can i test it if i add it?

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

I can provide response header. Or (if you have AWS account) you can test it via http://s3.amazonaws.com/doc/s3-example-code/post/post_sample.html

from sharex.

Jaex avatar Jaex commented on May 18, 2024

It require credit card to register so i can't test it.

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

I could be a tester :)

from sharex.

Jaex avatar Jaex commented on May 18, 2024

I'm not gonna implement something which i can't even test is it working. Working blindly is not an option for programming.

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

I think that there is nothing special about Amazon S3 POST request. This is just an option to get response header of a POST request. It can be tested on POST request to any site.
As to S3 specially, its response header is:
HTTP/1.1 204 No Content
Date: Mon, 20 Jan 2014 06:03:36 GMT
ETag: "59ddb92e0abe7b8f24d67981e12e97dc"
Location: http://donnicky_screenshots.s3.amazonaws.com/2.img
Server: AmazonS3

from sharex.

Jaex avatar Jaex commented on May 18, 2024

How to parse response header? Custom uploader section already don't have any space to insert new controls.
Adding it as uploader will be better choice so other peoples can use it too. But it not gonna happen when it is paid service.

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

Custom uploader has a combo box with response type. Just add there "Response header". And then it can be parsed by regex as it is already implemented.

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

I could even do not mention about S3. It is just one more option to get POST request reponse.

from sharex.

Jaex avatar Jaex commented on May 18, 2024

Regex applying in response because it is string. But response headers is name value array so how regex can work properly like that?

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

Just concat the array elements to a single string with some separator I think. Like this:
Date: Mon, 20 Jan 2014 06:03:36 GMT|ETag: "59ddb92e0abe7b8f24d67981e12e97dc"|Location:http://donnicky_screenshots.s3.amazonaws.com/2.img

from sharex.

Jaex avatar Jaex commented on May 18, 2024

Now how am i supposed to test it? I need to find one page which returns response headers.

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

Custom uploader settings to get POST request header response:
{
"Name": "TestPostResponseHeader",
"RequestType": 0,
"RequestURL": "http://donnicky_screenshots.s3.amazonaws.com/",
"FileFormName": "file",
"Arguments": {},
"ResponseType": 0,
"RegexList": [],
"URL": "",
"ThumbnailURL": "",
"DeletionURL": "",
"AutoUseResponse": true,
"Input": null,
"ResultURL": null,
"ResultThumbnailURL": null,
"ResultDeletionURL": null
}

from sharex.

Jaex avatar Jaex commented on May 18, 2024

You are using old version of ShareX look like.

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

Updated:
{
"Name": "TestPostResponseHeader",
"RequestType": 0,
"RequestURL": "http://donnicky_screenshots.s3.amazonaws.com/",
"FileFormName": "file",
"Arguments": {},
"ResponseType": 0,
"RegexList": [],
"URL": "",
"ThumbnailURL": "",
"DeletionURL": ""
}

from sharex.

Jaex avatar Jaex commented on May 18, 2024

I still can't test because:
Error: Message:
The remote server returned an error: (400) Bad Request.

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

Yes, it returns error. But this is a kind of response too, and it also has a header, too. We just need header to convert it to a single string. Why this header is bad for testing?
HTTP/1.1 400 Bad Request
x-amz-request-id: 4868966BDCA8BC69
x-amz-id-2: 63VlGB+Mxipgu23gS9CM2DkYv+kSggsFNc5T1bkUcey47wgst/pESB/MnfNGnOfl
Content-Type: application/xml
Transfer-Encoding: chunked
Date: Mon, 20 Jan 2014 06:46:32 GMT
Connection: close
Server: AmazonS3

from sharex.

Jaex avatar Jaex commented on May 18, 2024

I already added it but i can't be sure is it working and your string not verify that my codes works...
I seriously hate this making something and don't know is it works.

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

Maybe this:
{
"Name": "TestPostResponseHeader",
"RequestType": 0,
"RequestURL": "https://posttestserver.com/post.php",
"FileFormName": "file",
"Arguments": {
"someParam": "someValue"
},
"ResponseType": 0,
"RegexList": [],
"URL": "",
"ThumbnailURL": "",
"DeletionURL": ""
}

from sharex.

Jaex avatar Jaex commented on May 18, 2024

Works i think: https://dl.dropbox.com/u/14076298/ShareX/2014/01/Ps4bPM0ILk.png

from sharex.

nikolaybobrovskiy avatar nikolaybobrovskiy commented on May 18, 2024

Wow! Thanks a lot!

from sharex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.