Web based family history software

file Question Media Upload Error

  • thomas52
  • thomas52's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Western North Carolina
More
4 weeks 2 days ago #116819 by thomas52
Media Upload Error was created by thomas52
Attempting to upload media, I repeatedly get an error: "SyntaxError: Unexpected token '<', "
I suspect a corrupted file, but which file should I check or replace?

Research is what I’m doing when I don’t know what I’m doing – Wernher von Braun

Please Log in or Create an account to join the conversation.

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
4 weeks 2 days ago #116820 by bertkoor
Replied by bertkoor on topic Media Upload Error
I suspect a technical error: the response is a html error document and does not contain a json response.

If you can reproduce it (I cannot) then look "under water" (inspect) with your browser. One of the network requests likely has failed, your browser will show the raw response.

stamboom.BertKoor.nl runs on webtrees v2.2.6

Please Log in or Create an account to join the conversation.

  • thomas52
  • thomas52's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Western North Carolina
More
4 weeks 2 days ago #116821 by thomas52
Replied by thomas52 on topic Media Upload Error
webtrees.min.js?v=2.2.6:1 POST adkins.ws/tree/Adkins.GED/create-media-object 403 (Forbidden)

Research is what I’m doing when I don’t know what I’m doing – Wernher von Braun

Please Log in or Create an account to join the conversation.

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
4 weeks 2 days ago #116822 by bertkoor
Replied by bertkoor on topic Media Upload Error
Sorry, don't know. My test succeeded .
You don't see any further details?
Can it be CloudFlare stopping you?

stamboom.BertKoor.nl runs on webtrees v2.2.6

Please Log in or Create an account to join the conversation.

More
4 weeks 2 days ago - 4 weeks 2 days ago #116823 by Lars1963
Replied by Lars1963 on topic Media Upload Error
Same as this one? 
[url] www.webtrees.net/index.php/forum/webtree...in-adding-media-type [/url]​​​​
Last edit: 4 weeks 2 days ago by Lars1963.

Please Log in or Create an account to join the conversation.

More
4 weeks 2 days ago #116825 by martin1
Replied by martin1 on topic Media Upload Error
I have a similar problem in 2.1.27.
I think my browser (Firefox) is sending no data.
Chrome works.

Please Log in or Create an account to join the conversation.

More
4 days 3 hours ago #117015 by Anke
Replied by Anke on topic Media Upload Error
Version 2.2.6 - my steps:

1.
Control panel -> Upload media files
I selected one local .jpg and set a subfolder on the server and I clicked upload. 
Not sure I got a confirmation, but empty upload forms were displayed again.

2.
Control panel -> manage media
The uploaded file is not listed.

3.
My page -> Individual
Add media file - from server. I enter the subfolder and images are listed, obviously only those with a title, they are not listed by filename. I haven't been able to add a title in step 1 or 2.
Add media file - from PC. The .jpg is uploaded with its original file name and I can add the meta data.

4. 
Control panel -> Manage media
All of a sudden my peviously uploaded picture (see steps 1. and 2.) is listed. But the file name has been replaced by a unique id.

5.
Control panel -> My family tree -> Preferences
Add unique identifiers is set to "no".
A few days ago I had set UIDs to yes, assuming this would only affect individuals and families. After seeing that Check for errors shows some hundred warnings not saying that UIDs aren't recommended, I disabled UIDs. Thus the picture shouldn't have gotten a unique number.

6.
Control panel -> Upload media files
I upload another picture like I did in step 1. The upload is confirmed, with its original file name.

7.
Control panel -> Manage media
Cannot find the last uploaded picture - until I select Unused files. Both uploaded pictures are there, and by their orininal file names.

All of that is a logic I don't understand. How are file uploads processed? When are they stored in the media (sub)folder, when in the database and when are they cached? And which image source is loaded/displayed in webtrees? What do I have to do to refresh the media list? (A browser window refresh doesn't do the trick.)

Anke


 

Please Log in or Create an account to join the conversation.

More
3 days 23 hours ago - 3 days 14 hours ago #117017 by Franz Frese
Replied by Franz Frese on topic Media Upload Error
Do read  wiki.genealogy.net/Webtrees_Handbuch/Anl...dien-Datens%C3%A4tze

It's not necessary to use the control panel to have an image shown.

The control panel is only for admins.

Editors can connect images too.

by the way: using "Add a media object" , did you ever click onto the +-icon (plus - sign) on the left ? Here you get all for to have a new image from your local computer (and others). [your point 3, but uncheck (your point 4) "Create a unique filename"]. The created mediaobject is auto assigned, to the environment, from where you did "Add a media object". (there are many places where you can add, not only for an indivduum)
 

If genealogical work isn't meant to be shared, I wonder what it's meant to be at all: For to get help, tell the address of your webtrees site!
mine is: freris.de
Last edit: 3 days 14 hours ago by Franz Frese.

Please Log in or Create an account to join the conversation.

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
3 days 9 hours ago - 3 days 9 hours ago #117019 by bertkoor
Replied by bertkoor on topic Media Upload Error
Hi Anke,

I do appreciate you first look whether a similar topic already exist. But if I were a moderator, then I'd be tempted to split this thread in two so to make it appear as if your post was the start of a new thread. Yes the title is an exact match, but what you wrote is not a continuation of, and not related to the problem(s) discussed earlier.

1. Control panel -> Upload media files
I selected one local .jpg and set a subfolder on the server and I clicked upload. 
Not sure I got a confirmation, but empty upload forms were displayed again.

2. Control panel -> manage media
The uploaded file is not listed.

[...]

7. Control panel -> Manage media
Cannot find the last uploaded picture - until I select Unused files. Both uploaded pictures are there, and by their orininal file names.

 

That is indeed how it works. You (or anyone with role Administrator) can upload a file to the server with FTP or with this function of the Control Panel, whichever function you find more convenient. I think it's only since webtrees 2.2.6 that you can upload up to ten files in one go. In earlier versions the form could handle just one image at a time.

2 & 7: A file in a folder only becomes "media" once there is a Media Object which uses it.
The first checkbox on the "Manage Media" page has three options (with rather short labels which might have been chosen better) :
  • Show a list of Media Objects of which the files are local: residing on your server
  • Show a list of Media Objects of which the files are external: residing elsewhere
  • Show a list of Files residing on your server which have the potential to become a Media Object: they are at the right place, but there is not yet a media object in a tree using them
 

3. My page -> Individual
Add media file - from server. I enter the subfolder and images are listed, obviously only those with a title, they are not listed by filename. I haven't been able to add a title in step 1 or 2.
Add media file - from PC. The .jpg is uploaded with its original file name and I can add the meta data.

 
Can you check again whether you see a title or a filename? Because you're supposed to get the same list of "unused files" you found earlier in Control Panel - Manage Media. On my own server I see the file names ending with .jpg or .png. I don't think webtrees has the ability to extract a title from the (EXIF? ) metadata within an image.

If webtrees would show a full list of all files, then that's a potential security breach. The content could be confidential. Editors are not allowed to have access to anything and everything. Images are supposed to have restricted access as well! So you only get a list of files on the server of which it is very likely you want to make a Media Object of.

4. Control panel -> Manage media
All of a sudden my peviously uploaded picture (see steps 1. and 2.) is listed. But the file name has been replaced by a unique id.

 
You must have been experimenting with uploading from the page of an individual. That form has a checkbox "Create a unique filename". If you upload via the Control Panel, then that option is not there and files should have their original name. Unless it already exists, which can happen if you're experimenting. webtrees might then create a unique (random) name.

5. Control panel -> My family tree -> Preferences
Add unique identifiers is set to "no".
A few days ago I had set UIDs to yes, assuming this would only affect individuals and families. After seeing that Check for errors shows some hundred warnings not saying that UIDs aren't recommended, I disabled UIDs. Thus the picture shouldn't have gotten a unique number.

 
I can assure you that "Unique identifiers" does not affect file names. This is about the subtag _UID or UUID. The underscore indicates it is a "custom" tag: not all programs which deal with GEDCOM files will handle them properly.

What I learned about software testing: always start and end with a clean work environment. Clean up any mess before and after work. It might lead to confusion or errors. This also applies to cooking, car mechanics, etc.

All of that is a logic I don't understand. How are file uploads processed? When are they stored in the media (sub)folder, when in the database [...]
I'm glad you ask about the database. Some knowledge of how it works under the hood won't harm.

The webtrees database contains tables (with rows) for individuals, families, notes, sources, repositories, etc: this is the core of the genealogical data. Each row contains a raw GEDCOM record, which is a snippet of the imported GEDCOM file (and of the GEDCOM file you'd export)
Then derived from that are some indexed tables with names, dates and places for searching. Also there's a table with all the registered users and some tables with preferences for the site, and also per tree, module and/or user.

What the database does not contain is the images themselves. These are only kept in the 'data/media/' folder. It's a bit early now, but if you read the FAQ article about "moving server" you'll notice that you need both the content of the 'data' folder and a full SQL database backup restored.

There's probably multiple reasons for doing it this way. One reason I can think of is that this mimics the design of GEDCOM itself. That is a rather old specification of how to transfer genealogical data from one place (specificly: members of the Church of Jesus Christ of Latter-day Saints (aka Mormons) all around the globe) to another (specificly: the LDS headquarters in Salt Lake City, Utah, USA.) As you might already know, a GEDCOM file is a plain text file with a specification regarding its format. Since it is text only, it cannot cater for binary data such as images (uuencode was not invented then yet). The LDS does not care about images, they only want names & dates for their own purposes. And while one 5¼MB disk can hold in raw text the data about hundreds of individuals, it can contain perhaps only a dozen compressed images. The idea is thus (in GEDCOM at least) that the text data is physically separated and comes transferred separated from the binary images. So you have a small GEDCOM file, optionally accompanied by a large collection of its images.

So this then is the GEDCOM representation of a person, his profile picture, his birth and a scan of his birth registry entry:
Code:
0 @X1@ INDI 1 NAME Joseph /Smith/ 2 NOTE most people called him Joe 1 OBJE @X2@ 2 NOTE this photo was in his passport 1 BIRT 2 DATE 23 FEB 1876 2 PLAC Springfield 2 OBJE @X3@ 1 RESN NONE 0 @X2@ OBJE 1 FILE JoeSmith_passport_1898.jpg 2 TITL passport photo of Joe Smith 2 FORM jpeg 3 TYPE PHOTO 1 NOTE in 1898, so aged circa 22 years 1 RESN NONE 0 @X2@ OBJE 1 FILE Springfield_birthregistry_1876_p18.jpg 2 TITL page 18 contains birth registration of Joseph Smith 2 FORM jpeg 3 TYPE FILM 1 RESN NONE


GEDCOM holds some metadata about the images, but it does not specify where they are stored. The filename may include a path name. Some applications put a full absolute path like 'C:\Documents\...' there, but it is supposed to be a relative path. Whatever content of the 'FILE' tag, its value is appended to what is specified in webtrees as the media folder for the tree. And there's the image stored.

Subfolders: yes you can use subfolders. I know I know, but I will repeat my advice anyway: do not bother. It is wasted energy. You can now think of the perfect schema to divide content among subfolders. But I can guarantee:
1. There will be users not knowing
2. There will be users objecting
3. Groups 1 and/or 2 might contain your future 'You'

Anyways, that is my advice. You can take it freely, since I do not use it myself (Groucho Marx)

[...] and when are they cached?
We have not discussed caches yet. Let me start off with a mild joke:

Information Technology has two hard problems:
1. Naming things
2. Cache invalidation
3. Off-by-one errors


 


As with everything in http, your browser may hold a cache of things it loaded earlier. Usually not of webtrees pages, because these can be edited so browsers should know that caching them is not appropriate. But images are generally good candidates for caching: they won't change often and they are relatively large. In general you won't need to empty the browser cache. What I find easiest to do (the least searching where the options are, it's only one direct click) is start browsing in a private tab.

The image in the 'data/media/' folder may not directly be the images you present to visitors. Images may have a watermark added, and profile pictures and such are resized. These are all stored somewhere in the 'data/cache/' directory. In case you change the watermark: empty that cache. Can be done via FTP or via the Control Panel.

Kind regards,
Bert[/quote]

stamboom.BertKoor.nl runs on webtrees v2.2.6
Last edit: 3 days 9 hours ago by bertkoor.

Please Log in or Create an account to join the conversation.

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
3 days 9 hours ago #117020 by bertkoor
Replied by bertkoor on topic Media Upload Error
Ouch. Do you see the "[/quote]" at the end? That means there is a tag inbalance and hence I cannot edit the post anymore.

Anyway, there's an error I'd like to correct. In the "code" block the last "0 @X2@ OBJE" should be "0 @X3@ OBJE"

stamboom.BertKoor.nl runs on webtrees v2.2.6

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum