Comments (7)
It should works now.
from wikiapi.
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.
The two situations are not the same.
You may try{...}catch(e){console.error(e);}
to see what happens.
from wikiapi.
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.
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.
OK. 😺 Please open a new issue.
from wikiapi.
I cleaned up the issue and split it. Done for today. I will open other issues later this week.
from wikiapi.
Related Issues (20)
- Download all files from a (Commons) category HOT 3
- Snowpack support HOT 9
- SyntaxError: Unexpected token '.' HOT 8
- Example broken on OSX HOT 5
- download is not a function HOT 4
- `.download()` scalability ? HOT 6
- "Too many values supplied for parameter \"pageids\". The limit is 50." HOT 3
- `.download()` : reduce calls to api.php, directly hit on https://upload.wikimedia.org HOT 9
- Cannot download : triggerUncaughtException HOT 6
- `.download()` : compare local and remote files by timestamps before downloading HOT 4
- `.download()`: `session.to_namespace('Category Name', 'Category')` needed HOT 1
- `.download()` on category, recursive : questions. HOT 4
- throws "API_URL.includes" is not a function when creating wikiapi instance HOT 5
- Please publish new version with delete
- Provide an option to set a custom User-Agent string HOT 4
- New Logo for framework ! HOT 2
- [Suggestion]: Merge this project. HOT 11
- Failed login on wikibase edit only ? HOT 5
- TypeError: Cannot read properties of undefined (reading 'id') HOT 7
- .upload(): The \"token\" parameter must be set ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wikiapi.