In this document:
http://dev.evernote....ating_notes.php
They show how to create an image attachment to a new Evernote note. The example shown uses a file local to the web server. I have a desktop app that creates a local file (a movie) and then opens a browser window to do its work using the Evernote (cloud) API. That window navigates to the URL that does the OAuth step and then control is passed to the PHP script that creates the new note.
Given the scenario, what is the correct sequence to get the movie file on the user's local PC into the Evernote note? I will pass the full path to the file (e.g. - C:\movies\newmovie.avi) to the PHP script when I open the browser window. From that PHP script that builds the Evernote Note and stores it, Is it as simple as passing the file path like this?:
$resource->attributes->fileName = 'C:\movies\newmovie.avi';
Or do I have to prepend the URL with the 'file://' prefix like this?:
$resource->attributes->fileName = 'file://C:\movies\newmovie.avi';
Or (hopefully not) do I have to upload the file to my web server first and then pass the path to that file on the web server to $resource->attributes->fileName? I know I need to send a createNote() API request with the data as part of a Note resource structure:
http://dev.evernote....Struct_Resource
But I'm wondering what is the best method to do that. I am concerned about embedding a 5 to 10 MB chunk of data in a resource structure and making an Evernote API createNote() call with it. I was wondering if there was a way to get the data directly from the user's PC to the Evernote servers in a more direct manner, something akin to an FTP upload for example, that does not involve first uploading the file to an intermediary web server before making the createNote() call that aggregates the uploaded file in a big resource data structure.
-- roschler
Add files on the user's local hard disk to a new Note?
Started by roschler, Jun 19 2012 01:10 AM
help
6 replies to this topic
#3
Posted 19 June 2012 - 04:33 PM
@JulienBoedec,
That example does an fread() from a file local to the web server. I am trying to avoid that because that implies having to upload the file via FTP or a large POST operation to my web server before creating the note so it can be accessed as a local file by fread(), or one of the other PHP open/read calls, when I the API's createNote(). I'd like to find a way to get a large attachment to the Evernote servers by accessing a file directly that exists on the users local PC, not on my web server. For example, the Evernote Windows client must be doing something like that when doing a Sync operation if it finds a Note on the user's local Note store that has attachments. I'm hoping there are facilities in the Cloud API that might help me do the same.
-- roschler
That example does an fread() from a file local to the web server. I am trying to avoid that because that implies having to upload the file via FTP or a large POST operation to my web server before creating the note so it can be accessed as a local file by fread(), or one of the other PHP open/read calls, when I the API's createNote(). I'd like to find a way to get a large attachment to the Evernote servers by accessing a file directly that exists on the users local PC, not on my web server. For example, the Evernote Windows client must be doing something like that when doing a Sync operation if it finds a Note on the user's local Note store that has attachments. I'm hoping there are facilities in the Cloud API that might help me do the same.
-- roschler
BitQwik - Search your Evernote notes with a powerful Artificially Intelligent assistant!
TagHunter - The free intelligent power search tool for Windows Evernote users that have lots of Tags
TagHunter - The free intelligent power search tool for Windows Evernote users that have lots of Tags
#4
Posted 19 June 2012 - 08:13 PM
The only way to send a file is by using CreateNote or UpdateNote and therefore attaching the binary content of the file to the note's structure. In your case, you will have to to send it to your server.
#5
Posted 19 June 2012 - 08:20 PM
Ok thanks Julien. If you've got a suggestion box I'd love to see an addition to the API that allows for some form of direct transfer to the Evernote servers. Entities like the Web Clipper or the Windows/Mac native clients do it so there must be some currently private method for doing that. If there was a way for 3rd parties like myself to do it that would be great. An app that deals with large files that has to funnel everything through a single server could create a pretty hefty bandwidth bill if it really became popular and that could make the app untenable as a free or freemium app.
BitQwik - Search your Evernote notes with a powerful Artificially Intelligent assistant!
TagHunter - The free intelligent power search tool for Windows Evernote users that have lots of Tags
TagHunter - The free intelligent power search tool for Windows Evernote users that have lots of Tags
#6
Posted 20 June 2012 - 03:15 AM
Do any of the web clippers transfer files from the local disk? I thought they only sent data from the page selected, presumably grabbed direct from the DOM by Javascript.
Julien has already made the point about how to attach binary content. That's how the Evernote official desktop clients do file "transfer".
Julien has already made the point about how to attach binary content. That's how the Evernote official desktop clients do file "transfer".
#7
Posted 20 June 2012 - 03:28 AM
@AndyDent,
I wasn't implying that the Web Clipper transfers local disk files. Just that it has a way to upload large data blocks to the Evernote servers directly.
Are you saying that they upload the files to a separate Evernote web server before transferring them to Evernote instead of doing a direct POST or potentially an FTP or similar operation? Then if so, I'd like to see the API expanded to allow API consumers to use those servers too instead of having to run lots of a content through a potentially lightweight web server in preparation of note creation and delivery. As I said, if an application really took off the bandwidth bill could make being free or freemium untenable fast. This is an assumption on my part but you're essentially doing the same thing when you create a new Note in the Windows client and allow the next Sync operation to ferry the Note data to the Evernote web servers. It's just indirect and not available to apps that are using the Cloud API solely.
-- roschler
Do any of the web clippers transfer files from the local disk? I thought they only sent data from the page selected, presumably grabbed direct from the DOM by Javascript.
I wasn't implying that the Web Clipper transfers local disk files. Just that it has a way to upload large data blocks to the Evernote servers directly.
Julien has already made the point about how to attach binary content. That's how the Evernote official desktop clients do file "transfer".
Are you saying that they upload the files to a separate Evernote web server before transferring them to Evernote instead of doing a direct POST or potentially an FTP or similar operation? Then if so, I'd like to see the API expanded to allow API consumers to use those servers too instead of having to run lots of a content through a potentially lightweight web server in preparation of note creation and delivery. As I said, if an application really took off the bandwidth bill could make being free or freemium untenable fast. This is an assumption on my part but you're essentially doing the same thing when you create a new Note in the Windows client and allow the next Sync operation to ferry the Note data to the Evernote web servers. It's just indirect and not available to apps that are using the Cloud API solely.
-- roschler
BitQwik - Search your Evernote notes with a powerful Artificially Intelligent assistant!
TagHunter - The free intelligent power search tool for Windows Evernote users that have lots of Tags
TagHunter - The free intelligent power search tool for Windows Evernote users that have lots of Tags
Also tagged with one or more of these keywords: help
![]() |
General Discussions →
Evernote General Discussion →
Evernote Localization →
HELP ME ASAPStarted by MSAndrews, 20 May 2013 |
|
|
|
Mac
Evernote Products →
Evernote →
need help downgrading from 5 to 3. it's ugly...Started by Paul.Evernote, 14 May 2013 |
|
|
||
General Discussions →
Evernote General Discussion →
HELP NEEDED: Restore Previous Notebook Assignments of NotesStarted by mrh75, 05 May 2013 |
|
|
||
General Discussions →
Evernote General Discussion →
My evernote has not synched in over 2 weeks!Started by MmSA, 28 Apr 2013 |
|
|
||
Windows
Evernote Products →
Evernote →
NewbieStarted by JonLon, 17 Apr 2013 |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users














