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

Allow attaching files as links when importing from local files (RIS, BibTeX etc.) #329

Closed
aurimasv opened this issue May 24, 2013 · 24 comments

Comments

Projects
None yet
@aurimasv
Copy link
Contributor

commented May 24, 2013

Re https://forums.zotero.org/discussion/29033/bibtex-and-other-bibliographic-import-adding-pdfs-as-links-instead-of-attachments/

I wonder if we could add a checkbox to the "Import" dialog (i.e. the "Choose the file you want to import" dialog) that says something like "Link to file attachments. Don't copy them to Zotero library." I'll have to look into this.

Otherwise, this could be a hidden pref.

@simonster

This comment has been minimized.

Copy link
Member

commented May 24, 2013

Unfortunately, it's not possible to add a checkbox to an nsIFilePicker. It would be possible to write platform-specific code for this, but probably not worth the effort.

@jedfrechette

This comment has been minimized.

Copy link

commented Jul 4, 2015

Just adding a quick +1 to this feature request. Personally, I would prefer a global preference that controls whether the default is to copy or link files whenever a file is added, rather than a more limited import specific setting.

From my initial evaluation Zotero looks nice but without this feature adopting it and migrating my existing library is not feasible. For the same reasons already mentioned by numerous other users in the various threads on this topic I simply don't want Zotero managing my files.

Best of luck going forward and I'll subscribe to this issue in-case something changes in the future and I can reevaluate Zotero.

@reyman

This comment has been minimized.

Copy link

commented Jan 26, 2016

👍 for this feature, i don't want to recopy my 2000 pdf in a new folder ...

@KarlHegbloom

This comment has been minimized.

Copy link

commented Jan 26, 2016

This feature already exists. Try using the Zotfile extension, and also setting the preference you'll find in Zotero preferences... Advanced... Files and Folders... Linked Files Base Directory. I have that directory in Dropbox and it works great.

@reyman

This comment has been minimized.

Copy link

commented Feb 11, 2016

Yeah, but i don't want zotfile recopy all my pdf in a new folder... I want Zotero use the already declared file attribute in my imported bibtex !!

@KarlHegbloom

This comment has been minimized.

Copy link

commented Feb 12, 2016

Look through the settings for zotfile. I think you'll find that it can be
told to leave files where they are. It moves the file on renaming it, but
if you don't set a base directory I think it will rename but not move it.
Or you can not use rename under manage atachments.

On Thu, Feb 11, 2016, 10:29 Rey notifications@github.com wrote:

Yeah, but i don't want zotfile recopy all my pdf in a new folder... I want
Zotero use the already declared file attribute in my imported bibtex !!


Reply to this email directly or view it on GitHub
#329 (comment).

@protivinsky

This comment has been minimized.

Copy link

commented Oct 7, 2017

I don't think that zotfile provides you with this functionality. Even when exporting linked files via "Zotero RDF", they are again converted into copies in storage on re-import.

Would be really nice to provide some level of support for this, at least via specific translator. I have large collection of PDFs in a sensible structure and I prefer to access them in different ways and using highlighting and commenting in them frequently. If zotero has its own copies of all these files, then I basically cannot use these features in PDFs opened via zotero (or abandon my original directories and use zotero only). I used endnote until recently and would like to switch to an open-source alternative, only this missing feature makes such switch quite painful (fixing all the links for current collection manually).

@laclaro

This comment has been minimized.

Copy link

commented Jan 22, 2018

Hi,

I would like to emphasize the importance of this scenario in a teaching or university context.

I have a bibtex-file with file=/path values. The files reside on a network drive that is accassible to all peaple within the institutions network. I would like to import that file to make a portable lightweight-fulltext-searchable bibliography for my students available everywhere from within the network.
However, zotero does not link the files, but imports them (takes a lot of time and wastes space).

There is plenty of older discussions about this
https://forums.zotero.org/discussion/2358/home-dir-relative-storage-of-linked-files/p4
https://forums.zotero.org/discussion/comment/159416/

Please add this feature or someone implements an overriding plugin similar to the link-local-files mentioned above which gets triggered on bibtex-import.

Best,

Henning

@DanielBonnery

This comment has been minimized.

Copy link

commented Feb 22, 2018

+1 for that feature

@Zythyr

This comment has been minimized.

Copy link

commented Jun 10, 2018

+1 for this feature also.

I am migrating from Mendeley to Zotero using .ris which works great however the challenge is maintaining the links to file when importing is not currently supported by Zotero.

I have a large collection of papers organized on my local HD and when importing into Zotero I would like to import them as "Link to File…" instead of "Store Copy of File…".

@dstillman

This comment has been minimized.

Copy link
Member

commented Jun 10, 2018

@Zythyr: We've added a Mendeley import feature in the latest beta that you can try instead. It will preserve linked files.

@Zythyr

This comment has been minimized.

Copy link

commented Jun 10, 2018

@dstillman Awesome! Glad to know you guys are working on Zotero being able to import from Mendeley directly. Thank you very much!

I still +1 the feature to enable the option which will allow import as "Link to File…" instead of "Store Copy of File…". I think this feature would be helpful in general and not just for the use case of migrating from Mendeley. It seems myself and others have very specific way of organizing files locally and don't want to brake the that link. I think for myself and many others, we like to have control over organization of local files for easy access and management when not using Zotero. When I see Zotero/storage folder with random folder names, it fears me that I have to depend on Zotero to quickly access a file(s) I want to read instead of just find it in Windows Explorer. And yes I understand the random folder names are there for technical reasons related to database, cloud syncing, etc...

Just out of curiosity: When adding a files to Zotero, why not have BOTH link to the original file that is managed by the user on the local HD and also a copy that is managed by Zotero in the Zotero/storage folder?

@dstillman

This comment has been minimized.

Copy link
Member

commented Jun 10, 2018

When I see Zotero/storage folder with random folder names, it fears me that I have to depend on Zotero to quickly access a file(s) I want to read instead of just find it in Windows Explorer.

Files in the Zotero data directory still show up in your OS search, so you definitely don't need to rely on Zotero to open files. You can also use an OS smart folder to show just PDFs within the data directory for easily browse by name. More human-friendly organization of the data directory is also planned.

In any case, we know some people still prefer linked files. As part of the Mendeley import functionality we added an import dialog that shows up during all imports, so options like this are now a possibility where they weren't before.

@Zythyr

This comment has been minimized.

Copy link

commented Jun 10, 2018

@dstillman Very happy to hear you guys are working on new features! Thank you very much to and your team!

Also, another reason for +1 on this feature request is because with beta version doesn't support importing from Mendeley groups library. Thus I was using export each folder in my groups as .ris and importing into Zotero.

@peeter-t2

This comment has been minimized.

Copy link

commented Aug 12, 2018

+1 for OP or having it as a "link-don't-copy-as-default" as an opt-in in the preferences. Thanks for the hard work!

@dstillman

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

So there's now also the inverse request from Mendeley users of being able to force storing of files, even when they come from Mendeley's organized folder that we link to by default (basically, for when Zotero file syncing is more important than folder hierarchy). It might make sense to just make a general import option with a drop-down for whether files should be stored or linked.

The main question there is if there are situations where linking shouldn't be an option or shouldn't be used regardless of the setting. For example, I'm not sure if files in the Mendeley "Downloaded" folder should ever be linked, even if someone wants to link files in the organized folder. (Among other things, it's in the Application Support folder on Macs, and Zotero no longer stores files in Application Support because Preview won't resave PDFs opened from there, which is necessary for annotation in Zotero.) It's also pretty unlikely that someone should be linking to files from a Zotero export with a "files" subdirectory. Unless we add in certain exceptions, I'm not sure how we make this an option without causing some undesirable situations. And if we do add in exceptions, we run the risk of confusing people by not doing what the option says we're going to do…

@dstillman

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

I guess the solution for the Mendeley case would be to not show a general option and just have a checkbox to force storing. Then files in Downloaded would always be stored.

For regular imports, one option might be to restrict the option to absolute paths. Are there situations where we get relative paths from RIS/BibTeX/etc. files but people might want those to be linked rather than stored?

(This is also why a general Zotero preference, as requested by a few people above, isn't really a solution for imports and would need to only apply to manual adds — there are just situations where linking from an import isn't the right thing to do.)

@bwiernik

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2019

Some people might have, for example, a variety of different exported Endnote libraries for specific projects (such as different systematic reviews) with their own files folders that they want to keep together. I think for RIS/BibTeX/XML import, leaving relative linked files in place is probably best.

@dstillman

This comment has been minimized.

Copy link
Member

commented Jan 11, 2019

@bwiernik: We wouldn't be moving files in any case — the question is just whether we actually want to provide the option of linking to files in an export directory (instead of the default of storing them). But you're saying that someone may, in fact, want to import from such a directory and have files be linked to the files subdirectory?

@bwiernik

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2019

I've seen a fair number of folks who have had the workflow of making a library in Endnote for each review project. They kept the Endnote library and the files directory in a separate folder for each project. A similar structure is possible with some database exports. It seems plausible to expect that some folks might want to be able to keep all of the PDFs for a review in one location (and separate from files for other projects).

@01baftb

This comment has been minimized.

Copy link

commented Feb 7, 2019

I guess the solution for the Mendeley case would be to not show a general option and just have a checkbox to force storing. Then files in Downloaded would always be stored.

I think this is correct approach for Mendeley imports. I also agree with @dstillman that files in the Mendeley "Downloaded" folder should always be stored, even if user does not enable "force storing". It is because from my experience of using Mendeley, I think files that are placed in the "Downloaded" folder are due to users using Mendeley syncing features or because the file's item belongs to a "Group". Therefore, maybe it is safe to assume a user utilizing syncing in Mendeley will also utilize syncing in Zotero, and will not care about linking the files in the "Downloaded" folder.

Question: Because the case for Mendeley imports is simple relative to other import methods, will the "force storing" feature be implemented sooner?

@dstillman dstillman closed this in 04779d8 Mar 2, 2019

@dstillman

This comment has been minimized.

Copy link
Member

commented Mar 2, 2019

In the latest Zotero beta, I've added file-handling options to the import wizard:

file-handling-options

This allows files from Mendeley to be stored instead of linked, and it allows files from other imports (RIS/BibTeX/etc.) to be linked instead of stored. The default for Mendeley imports will now be to store files.

There are a couple exceptions:

  1. Files in the Mendeley "Downloaded" directory are always linked stored, for the reasons explained above.
  2. Files within the current Zotero 'storage' directory are always copied rather than linked, because there shouldn't be links to the 'storage' directory. (As an example, if you export an item with a stored attachment to BibTeX but choose not to include files, the .bib file will include a path to the file within the 'storage' directory. If you import that .bib file and choose to link files, Zotero will create another stored file rather than creating a link to the file in 'storage'.)

If you've already imported from Mendeley, the importer won't change existing attachment files, but I'm working on a feature that will allow linked files to be converted to stored files. I should have that ready within the next few days.

@01baftb

This comment has been minimized.

Copy link

commented Mar 4, 2019

@dstillman Awesome, new feature works smooth for Mendeley migration. Thank you very much.

There are a couple exceptions:

  1. Files in the Mendeley "Downloaded" directory are always linked, for the reasons explained above.

Isn't this exception opposite to what you were suggesting in the original comment? It is my understanding that you're conveying that files in the "Downloaded" folder should always be stored? Also, I think the "organized folder" feature in Mendeley allows you to choose where the files are stored, therefore, these files are most likely outside of the "Downloaded" folder, unless the user intentionally decides to keep the "organized folder" in the Downloaded folder. However, I have never used this feature, so I could be wrong. Note when I say "Downloaded" folder, I am refering to AppData\Local\Mendeley Ltd\Mendeley Desktop\Downloaded

For example, I'm not sure if files in the Mendeley "Downloaded" folder should ever be linked, even if someone wants to link files in the organized folder.

@dstillman

This comment has been minimized.

Copy link
Member

commented Mar 4, 2019

Yes, sorry, I meant always stored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.