to directly download txt file? - firefox

How to configure Firefox such that whenever a link to a txt file is clicked, this txt file will directly got downloaded to the local file system, without asking user what you want to do with the file and where you want to save this file to?
It seems that in the Firefox's Application Panel, there is no entry for txt file although I've already clicked a link to a txt file.
Thanks.

if you press ALT while you click on the link it should just save the link, so in your case it will just save the .txt file. Hope this helps!

Related

why does a file has different names in nautilus and terminal

when I look up in nautilus for a Desktop file it has the filename showed below:
Then I open in terminal and search for the same file, I found it has another name showed below:
Anybody knows why it is like this?
Thanks in advance
This is specific to .desktop files.
In GNOME and other freedesktop.org-compliant desktops, an application
gets registered into the desktop's menus through a desktop entry,
which is a text file with .desktop extension. This desktop file
contains a listing of the configurations for your application.
More information can be found here https://developer.gnome.org/integration-guide/stable/desktop-files.html.en

How to save opened text file in autohtokey

What is the way of saving open .txt file in autohotkey. Let say you have opened text file test.txt; and you would like to close it or close it with saving any edits that you have made to that file.
I'm unable to find any method on the internet/doc. It can be a simple #1:: hotkey. It's part of larger script and this is just for testing.
Thanks xDD

Not able to download Zip file from gmail which contains executable Jar in it

I have an email almost 4 years ago, which has Zip file in attachments containing executable jar file. I want to download that file. But, nowadays gmail doesn't allow to send or receive any executable file. Can anybody help me how can I download that zip from from my email?
Proceed at your own risk !!!!
Open the email in your browser
Go to the arrow next to the reply button, and press show original
When the new TAB is opened simply click on "Download original" and rename the file to email.eml!
Now you can open that eml file with almost any email client (Outlook, thunderbird .... )
The easiest solution would be this one, it takes 30 seconds to do. Simply open your web inspector and delete the display:none property for the google drive button. The button will then appears and you will be able to download your file in your Google Drive. From your Google Drive, you will be able to download your file on your computer.
Cheers
Step 1. Click on Show original option as shown in the image. Clicking this option opens a new tab with the original, MIME encoded message.
Step 2. Wait for the complete page to load. This might take a long time depending on the size of the attachment and your internet speed. Once the page has loaded completely, copy the content and paste to notepad. Save as 0.txt(any name you can choose).
Step 3. Now rename file 0.txt to 0.eml
Step 4. open the file in Outlook or any email client. you will see the email with attachment.
This way worked for me.
You can download it from the Android Gmail or Inbox app. Then you can put it in drive if you like to access it anywhere.
1. Download and install python 3.4 (https://www.python.org/downloads/release/python-343/)
2. Open up the mail that has the blocked attachment. Click on the arrow button next to reply and select show original
3. Wait for the complete page to load. This might take a long time depending on the size of the attachment and your internet speed. Once the page has loaded completely, save it. The filename will be 0.txt. Save it in a directory which does not have any other text file.
4. Open python and copy the following code. Save it to the same directory as 0.txt. Run the program by double-clicking on the saved .py file.
# Get your files that Gmail block. Warning message:
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled."
# Based on: http://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/
# Go to your emails, click the arrow button in the top right, "Show original", save to the same directory as this script.
import email
import sys
import os
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Press enter to process all files with .txt extension.")
input()
files = [ f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.txt') ]
else:
files = sys.argv[1:]
print("Files: %s" % ', '.join(files))
print()
for f in files:
msg = email.message_from_file(open(f))
print("Processing %s" % f)
print("Subject: %s" % msg['Subject'])
for pl in msg.get_payload():
fn = pl.get_filename()
if fn:
print("Found %s" % fn)
if os.path.isfile(fn):
print("The file %s already exists! Press enter to overwrite." % fn)
input()
open(fn, 'wb').write(pl.get_payload(decode=True))
print()
You should see your attachment downloaded to the same directory after some time.
Source- https://gist.github.com/stefansundin/a99bbfb6cda873d14fd2
Open the gmail email in your browser
Go to the arrow next to the reply button, and press show original
download original and save it with extension .eml
open it in oulook
Or if you are PHP programmer get mail source via mail menu option "Show original" copy file attachment base64 string save to file for example test.b64 and:
file_put_contents ('test.rar',base64_decode(file_get_contents('test.b64')));
Saves regular attachment file in test.rar
If you are using a smart phone, simply open the email, save the attachment, connect your smartphone to your computer, open the Download folder in your smartphone by using windows explorer and copy the file to your desktop.
Or, you could also forward this email from your smartphone to another email address and download it from there.
No need to struggle a lot. I struggled a lot in my browser, YouTube tutorials and some articles but finally my own idea worked.
I was trying to download sriyog_com.rar file which was blocked by gmail.
file blocked by gmail
THE BEST WAY :
Open the email which contains that blocked file in Mobile Application.
The save to Google Drive icon will appear
Mobile Phone Screenshot
Save the file in Google Drive
File ready to download
Now the file is ready to download.
Note : Its time saving rather than eml files and other long scripting.
Thanks
if you have smartphone, the easiest way is to open the gmail in gmail app and save the file to google drive(in gmail app save to google drive is active). go back to computer and open google drive and download the desire file.
Connect your gmail on one of the mail clients like Polymail, fetch your emails, download whatever you want :)
http://www.barfuhok.com/how-to-download-a-file-with-anti-virus-warning-on-gmail/
It worked for me the method 1 "Method 1: Save email and open it in Outlook"
After downloaded the original message I changed the downloaded file to .eml
Eg: original_msg.eml
In order to open the message with other email clients file must be in ".eml" format.
Then I opened the file in thenderbird, which is a popular free email client.
Now I can able to download files.
Thats it.
Hope it helps.
Open mail from Android
--> Go to the specific mail
--> You will find a download option
--> Download the ***.zip/***.rar file
--> Upload it to the google drive
--> Now download it or use USB cable to transfer data to your computer.
It's working for me.
Thanks
Five Steps to Solve Virus Blocked or Executable Files from Gmail.
Select Show Original
Download Original
Web Search eml reader online or you can visit
upload the downloaded eml file (from point 2).
you should be able to view and download the blocked attachments.
Online EML Reader
Show Original
Download Original
The best way I found out was to download the attachment or add it to your drive via Gmail app. It works fine.
Accessing the file via any email client that uses IMAP (maybe also POP) will allow downloading of the file.
Workaround : Simply access the same mail via gmail android app.. u can download it . no issues.
Just click forward the email and then click on the composed email
attachment
your file will get downloaded

Write to New File Created By Notepad In Lua

I'm aiming to open a new .txt file in Notepad and then write to it. Since the file I'm opening (notepad.exe) isn't the same file I want to write to (the new .txt file), I'm unaware of how I can write to the file. Here's the code I have so far:
local list = io.popen("notepad.exe","w")
print(list)
list:write("Tester")
list:flush()
Notepad is opened, but the text isn't written to the new file because the code is trying to edit notepad.exe instead.
What can I do to be able to edit the new opened .txt file? I don't want to actually save the file anywhere, so that's why I'm aiming to just put text in an untitled .txt file. Thanks in advance :)
Notepad does not respond console input.
You must find edit control on notepad's window and PostMessage keypressing event to it.
Or prepare temporary file and load it:
local list = io.open("newfile.txt","w")
list:write("Tester")
list:close()
os.execute("notepad.exe newfile.txt")

Excel .xlsx download - sharing violation error message on Open and Save combination

I've found this question posed a few times, but no definitive answers as yet. Looks like a decent solution would help quite a few people.
So we create an excel file (.xlsx) on the server and download it to the client using content-disposition 'attachment'. The Open Save dialog appears and all works fine if you choose Save, or Open and then Save As... However if you choose Open and then hit the Save... button then Excel hangs for a moment and then presents the message:
Your changes could not be saved to 'Export[5].xlsx' because of a sharing violation. Try saving to a different file.
then:
The file you are trying to open 'F8CAC020.IE5\HM2NBE5C\F8CAC020', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
then:
you finally get the Save As: dialog (assuming you pressed 'Yes').
Code for creating the file is:
Response.Clear()
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
Response.AppendHeader("content-disposition", "attachment;filename=Export.xlsx")
Response.AddHeader("Content-Length", New System.IO.FileInfo(NewFile).Length)
Response.TransmitFile(NewFile)
Response.Flush()
If you remove the content-disposition header you get the right sort of behaviour in Excel, but with the wrong name and no guarantee that the Excel document will not instead be shown in the browser (depending on client settings). If you press Open and then Save then you
get a message:
'default.aspx' is read-only. To save a copy, click OK, then give the workbook a new name in the Save As dialog box.
So the question is how to combine the 2 behaviours into a reasonable one:
Get the nice error message directly above, when you try to Open and then Save a downloaded file, but also specify that the document should be downloaded and given a default filename.
Cheers,
James
I believe there is a bug in the IE file download code that does not acknowledge the completed file transfer (download) from the web server, thus leaving a connection to the downloaded (temporary) file open when the save is attempted. That generates the "sharing violation" message. I tried the same code with FireFox and I don't get the same result, which surely leads me to believe this is an IE-specific problem.
Unfortunately, given that I believe this to be a bug in IE, I don't think there is presently a clean resolution to this issue.

Resources