Coder Social home page Coder Social logo

Comments (7)

kanasimi avatar kanasimi commented on June 14, 2024 1

It should works now.

from wikiapi.

hugolpz avatar hugolpz commented on June 14, 2024

After uploading the 2 files above to Github... Just for fun, I tried to change the file_path value from local path into the github url path https://user-images.githubusercontent.com/1420189/112379664-b9a79100-8ce8-11eb-981d-727884b32993.png . And.... it works ! See On Commons (if no admin delete it). Since the local path is correct, it's very likely an issue with local file reading.

I provided my whole code so you may easily test it if you wish.

EDIT: please note i am importing

//const fetch  = require('node-fetch'); // url
//const fs     = require('fs');   // local path

Which may mess up some of your code ??
EDIT: I shifted these two lines into comments and same error messages occurs.

from wikiapi.

kanasimi avatar kanasimi commented on June 14, 2024

The two situations are not the same.
You may try{...}catch(e){console.error(e);} to see what happens.

from wikiapi.

hugolpz avatar hugolpz commented on June 14, 2024

Oh. I. See..... 🤩

1) commons-upload.js now returns :

to_form_data: Failed to get file: [./reds/png/a-red.png]
{
  code: 'missingparam',
  info: 'One of the parameters "filekey", "file" and "url" is required.',
  '*': 'See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.'
}

On Commons's API > Upload we can read:

  • file: File contents. Must be posted as a file upload using multipart/form-data.
  • url: URL to fetch the file from.
  • filekey : Key that identifies a previous upload that was stashed temporarily.

It tried some stuffs with fs.read() but doesn't work.
So I'am lost. 😬 Your help is welcome to interpret the error above.

EDIT: move distinct rename error to distinct issue.

from wikiapi.

hugolpz avatar hugolpz commented on June 14, 2024

It does better but there is still a bump. If you are in Taiwan as I believe I prefer to report you this issue tomorrow. 👍🏼 🌃

from wikiapi.

kanasimi avatar kanasimi commented on June 14, 2024

OK. 😺 Please open a new issue.

from wikiapi.

hugolpz avatar hugolpz commented on June 14, 2024

I cleaned up the issue and split it. Done for today. I will open other issues later this week.

See #26 #27.

from wikiapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.