how to make one new web site be able to receive copy and paste photos and picture to another web site, for example, from https://www.wenxuecity.com/ to https://666parks.com/, what's coding for making this work? i can provide it to new web site administrat

nowhere2 童生 2026-03-24 14:40 4 0 返回 社区公告
N
nowhere2 童生 楼主
2026-03-24 14:40
第1楼

how to make one new web site be able to receive copy and paste photos and picture to another web site, for example, from https://www.wenxuecity.com/ to https://666parks.com/, what's coding for making this work? i can provide it to new web site administrator or programmer for reference?

hat you’re asking sounds simple (“copy images from one site to another”), but there are two very different technical cases — and one of them can break rules or laws.

Let’s clarify first 👇

⚠️ 1. Important limitation (very important)

You cannot reliably make a website automatically accept pasted images from another website (like Wenxuecity) unless:

The source allows it (no hotlink protection / CORS restrictions)
You download and re-upload the image

👉 Direct “copy → paste from one site to another” is NOT guaranteed to work due to:

Browser security (CORS)
Anti-hotlinking protections
Copyright restrictions
✅ 2. What DOES work (correct architecture)
✔ Approach A — Clipboard paste upload (recommended)

User copies image → pastes into your site → your site uploads it

🔧 Frontend (JavaScript)
document.addEventListener('paste', async (event) => {
const items = event.clipboardData.items;

for (let item of items) {
if (item.type.indexOf('image') !== -1) {
const file = item.getAsFile();

  const formData = new FormData();
  formData.append('image', file);

  await fetch('/upload', {
    method: 'POST',
    body: formData
  });
}

}
});
🔧 Backend (example Node.js)
const express = require('express');
const multer = require('multer');
const upload = multer({ dest: 'uploads/' });

const app = express();

app.post('/upload', upload.single('image'), (req, res) => {
console.log(req.file);
res.send('Upload successful');
});

app.listen(3000);

👉 This works if user:

Copies image (not just URL)
Pastes into your site
✔ Approach B — Paste image URL (more reliable)

User pastes image link → your server downloads it

🔧 Frontend
async function uploadFromUrl(url) {
await fetch('/upload-from-url', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ url })
});
}
🔧 Backend
const axios = require('axios');
const fs = require('fs');

app.post('/upload-from-url', async (req, res) => {
const { url } = req.body;

const response = await axios({
url,
method: 'GET',
responseType: 'stream'
});

const writer = fs.createWriteStream('uploads/image.jpg');
response.data.pipe(writer);

writer.on('finish', () => res.send('Saved'));
});
🚫 3. What you CANNOT do easily
Directly paste images from 666parks or Wenxuecity into your site without re-uploading
Automatically scrape images from another site (blocked or illegal depending on usage)
Bypass anti-hotlink protections
🧠 4. Best solution (what to tell your developer)

Give them this requirement:

👉 “Build a paste-upload system that:

Accepts clipboard images
Accepts image URLs
Downloads and stores images locally
Does NOT hotlink external images”
⚡ 5. Pro-level enhancement (very useful)

Add:

Drag & drop upload
Auto image compression
CDN storage (AWS S3 / Cloudflare)
🧭 Bottom line

✔ Works:

Copy image → paste → upload to your server
Paste image URL → server downloads

❗ Doesn’t work reliably:

Direct cross-site paste without upload

暂无回复,快来抢沙发吧!

  • 1 / 1 页
敬请注意:文中内容观点和各种评论不代表本网立场!若有违规侵权,请联系我们