How do I download a file sent by a user to my telegram bot? aiogram - telegram

I need to receive an image from the user so that the API can then process it. What is the algorithm for getting the file by the handler, and downloading it to my computer?
I tried to download it after finding out the file id, but the handler does not give an error that the id does not exist. My file is connected to the root via the router. It is advisable to use the method through it.

Related

"Something went wrong" message trying to authorize with Partner Connections Manager

When I load the Partner Connections Manager authorization URL in the browser, I get the following error message:
Something Went Wrong
What can I do to troubleshoot this?
Make sure that the OAuth Client ID matches between your Device Access project and the Partner Connections Manager (PCM) URL, and that you're using the correct Project ID in the URL.
Go to the Project Info page for your project in the Device Access Console. Note the Project ID and OAuth Client ID assigned to your project. Make sure these values match what you're using in the PCM URL.
For example, if the Project ID for your project is 32c4c3bc-fe0d-461b-b51c-f3885afff2f0 and the OAuth Client ID is 90471209828-u96nolblvuk5jv1b22gdfvov4qgbcbhh.apps.googleusercontent.com, then your PCM URL should look like:
https://nestservices.google.com/partnerconnections/32c4c3bc-fe0d-461b-b51c-f3885afff2f0/auth?
redirect_uri=https://www.google.com&
access_type=offline&
prompt=consent&
client_id=90471209828-u96nolblvuk5jv1b22gdfvov4qgbcbhh.apps.googleusercontent.com&
response_type=code&
scope=https://www.googleapis.com/auth/sdm.service
For more information, see Create a Project and Authorize an Account on the Device Access site.

How to provide the Write Access in Firebase without giving Read Access?

I am having a strange situation in my app where Unauthorised users can send me the messages. whereas It will be only one user who can have the read access to those messages.
I am using the $bindto to write on the database (with my google logged in and google authentication enabled) and reading it through email password authentication method .
I want that user could send the message without any authentication process.
Is this possible?
There is no way we can stop unautheticated user to get the data from firebase database. For this situation that I faced I was worried about that if a user download the JS file he can get the access of all my database. But there is a catch :
Since you whitelist your IP/domain name no one other than that domain can take the access.So, even if they download your file they will no be able to get the access as request will not be from authenticated IP/domain name.
The other way is using the anonymous authentication method so that u can anyhow authenticate user and by that you can atleast have the trail of who are working or modifying your data (IP tracking access log is also useful).

Calling a certificate to use as authentication for download

I'm trying to create a download tool that downloads multiple data files at numerous links from a single database that requires a username/password.
To be specific, these are netcdf files and when I am logged into the database, I can simply enter this URL, hit enter, and automatically download this data:
https://vesg.ipsl.upmc.fr/thredds/dodsC/GeoMIP/output/IPSL/IPSL-CM5A-LR/rcp45/3hr/atmos/3hr/r1i1p1/v20130428/vas/vas_3hr_IPSL-CM5A-LR_rcp45_r1i1p1_200601010300-205601010000.nc.dods?vas[0][0][0]
I'm trying to automate this process so I don't have to go to the database website and log in. I have tried using the username:password# above URL approach but I receive an HTML 500 error. So, I'm trying to use a certificate.
Using R.Utils, I entered in the server, username and password of the database. I was able to create what I think is a certificate (called 'C%3A') that should pass along my credentials. 'C%3A' seems to be an HTML file. Is this a certificate containing my credentials? If so;
How do I call this 'certificate' so that the individual URLs that I try to collect the data from know that I have the authorization to download this data?

HyperLink on the mail send from Unix

I am sending some text messages from the unix box to the normal internet mail id.
I Wanted to add a hyper link in those mails, but link to a file on the system not to a URL.
I'm doing it on local machine and i'm sending mail to my email-id.
In that mail, I need a link to file which resides on my system itself.
How I can do this?
Set your URL like this:
file:///full/path/to/file
Of course, that will only work locally. If clicked on another system, it'll refer to their local filesystem.

How to get the user account associated to the webdav request?

When accessing a webdav using Windows Explorer (Not IE), the call is redirected thru the svchost.exe process (with webclnt.dll).
When i check get the pid of the process that is connected to the local port, i get the pid of the svchost.exe process.
How can i get the user account that the call was associated to?
You can use an LSP like komodia LSP, and in the WSAStartup function, you can user GetUserNameW() to retrieve the user account associated with the thread.

Resources