Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer.sh response example? #3

Open
AeliusSaionji opened this issue Jan 26, 2023 · 12 comments
Open

Transfer.sh response example? #3

AeliusSaionji opened this issue Jan 26, 2023 · 12 comments
Labels
bug Something isn't working question Further information is requested

Comments

@AeliusSaionji
Copy link

Hello! I can't seem to figure out how to get the response from transfer.sh.

The response is just text, but following the documentation regex, I get a "success" message, but nothing else.

(also, could the documentation open in the browser instead of inside the app's chrome view?)

Thanks!

@SrS2225a
Copy link
Owner

SrS2225a commented Jan 27, 2023

Hello, the reason you are getting just a success message is because Custom Uploader cannot find any value using the parameters you gave to the field. There is actually no need to define a URL parse as by default when leaving the filed blank, it will automatically try to find the url out of the response. The custom url parser is more meant for advanced users anyways as for hosts that do not give you the full url as default, or may have multiple urls in the same response, or if it cannot find that response url for whatever reason.

If you want to use the url parserr, since transfer.sh just gives the url in the full response and nothing more, you can use $response$ in the custom parser which will tell it to give you back the whole server response. I plan on removing $response$ in a future release anyways since it is not really needed anymore. Or if you still want to use regex, it would be $regex:[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?$ as example to get the full url.

By the way, there was an issue I noticed not too long ago with the way the parser handled regexes, so maybe thats why it could not find any value as well. This has been fixed, and should now be on the latest release

@SrS2225a SrS2225a added the question Further information is requested label Jan 27, 2023
@AeliusSaionji
Copy link
Author

AeliusSaionji commented Jan 28, 2023

For the following values

  • blank
  • $response$
  • your example regex

all I see is "upload successful", but the result url isn't given to me in any way I can see.
I'm running 1.0.2 (whatever fdroid/izzy gave me) so maybe I'm running into that bug still.

Any empty or valid entry for URL parse just gives me as shown:
5af7ecea-f3e0-473c-8fe1-22e743c0483d

transfer.sh doesn't have any account system, so I'm just tossing files into a black hole right now 😄

@SrS2225a
Copy link
Owner

SrS2225a commented Jan 28, 2023

How intriguing. It works just fine for me. Did you make sure to click "Save" at the bottom once you edited your file host? Make sure you have trasfer.sh set as your file host as well. I am on the same version as you.

image

image

I even tested it with your trasfer.sh, and it worked fine. Maybe try importing my transfer.sh configuration?

https://media.nyxgoddess.org/talI2/wavukAho82.json

@AeliusSaionji
Copy link
Author

Yours worked- the difference was that I had Form Data Name as filedata

I was led astray by this
image

@AeliusSaionji
Copy link
Author

One more small problem - I tried sharing that json to Custom Uploader to test that everything is working, and it seems that .json files specifically will not be uploaded from share target.

@SrS2225a
Copy link
Owner

SrS2225a commented Jan 28, 2023

Glad to hear that it is working now! Just make sure that the form data field is correct as different hosts like them different ways. filedata should be fine, my guess is to what happend is that you had some kind of field you did not see that should of not been there, and as a result trasfer.sh was giving back a "Null", as I remember falling into a simular issue before. I also made a bug fix that fixes your regex issue, so feel free to re-download it.

Though, I am confused as what you mean by ".json files will not be uploaded to the target". I tested it with transfer.sh on my end and json files work fine. As long as the file host accepts the choosen file type, it will upload as normal. Try with another json file, maybe there is an issue with the one you are trying to upload.

@AeliusSaionji
Copy link
Author

AeliusSaionji commented Jan 28, 2023

Here's a video of me trying to share the snippet you sent me above, using the snippet you sent me as the server.

InShot_20230127_225754452.mp4

Other files work, 🤷

@SrS2225a
Copy link
Owner

Are all the other files that you tried with were uploaded with the same method? I tried reproducing with the exact same steps as you have mentioned and my json file uploads as normal to transfer.sh. Like I said earlier, try with another json file; it appears there is an issue with that particular file. You could also try choosing the file from the main screen of the app. What it looks like to me is that the app is failing to read the file, but there is not really much that I can do without being able to reproduce it

@AeliusSaionji
Copy link
Author

AeliusSaionji commented Jan 29, 2023

I tried a different JSON, same story.

Are you on Android 13 yet? Because in a number of bug reports I've filed recently, the problem was some back end change in Android 13.

I was able to share the json to the fastmail app just fine, it's something on custom_uploader's end. I tried to use logcat, but I couldn't see any particularly helpful entries in the log.

I do have this though.

0855c266-dcd4-4bc2-ae51-10500cf5d2c5

@SrS2225a
Copy link
Owner

SrS2225a commented Jan 29, 2023

Quite a strange bug indeed. Wired how it is working for me, but not you. I am on android 13 as well and as mentioned earlier, uploading json files work just fine. Have you tried uploading it from the main ui and not with sharing? I would also suggest trying another file host and see if that one works.

Could you also give me your phones modal number and the json file you used so I can see if I can reproduce the error with that?

@SrS2225a SrS2225a added the bug Something isn't working label Jan 29, 2023
@AeliusSaionji
Copy link
Author

Looks like the problem is specific to shares from Material Files (https://github.com/zhanghai/MaterialFiles)

Although it still only affects json and only is a problem with custom uploader.

Let me know if you can't reproduce the problem with just material files.

@SrS2225a
Copy link
Owner

Hello,

Thanks for working with me on this. I was able to reproduce the bug with material files. Turns out the reason why you were seeing that bug was because when you used the share functionality files with the mime type of text never get received. My guess is that there is some kind of data stream issue with Material Files causing the library I use to add this functionality to not get the shared data as it would still see that something was shared just fine. Ill create a bug report tomorrow with Material Files about this. In the meantime, I would suggest you stick with your default file manager until this is fixed. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants