Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

511
Visualizações
net::ERR_FILE_NOT_FOUND. reactjs and mongodb error

im trying to make a social media website that you can upload videos and it will play them on the home screen. Im having problems where you can see the video you clicked on in the upload page but as soon as it refreshes the video disappears and it only shows a black screen on the video. It is on a localhost right now, which I think is the reason it wont work.

this is the link that im getting from the database: blob:http://localhost:3000/1e655870-bb8e-44e5-b35b-8a9012d31116

is there a way to make a link to a video that always exists?

here is the upload page:

 const [files, setFiles] = useState([]);
 const [title,setTitle] = useState("");
 const [userData, setUserData] = useState([])

 const onDrop = useCallback(acceptedFiles => {
   setFiles(acceptedFiles.map(file => Object.assign(file, {
   preview: URL.createObjectURL(file)
 })));
}, []);

const {
getRootProps,
getInputProps,
isDragActive,
isDragAccept,
isDragReject
} = useDropzone({
onDrop,
accept: 'video/mp4'
});

  const style = useMemo(() => ({
...baseStyle,
...(isDragActive ? activeStyle : {}),
...(isDragAccept ? acceptStyle : {}),
...(isDragReject ? rejectStyle : {})
 }), [
isDragActive,
isDragReject,
isDragAccept
]);

 const thumbs = files.map(file => (
<div key={file.name}>
  <video
  className="videoPrev"
    src={file.preview}
    alt={file.name}
    controls
    style={{maxHeight:"100mm",maxWidth:"100mm"}}
  />
  
</div>
));

useEffect(() => {
const currentUser = AuthService.getCurrentUser();

AuthService.getUser(currentUser.id).then(results => {
    console.log(results.data.user);
    setUserData(results.data.user);
}).catch(err => {
    console.log(err.message);
});

files.map(file => console.log(file.preview));
 },[])


 // clean up
 useEffect(() => () => {
  files.forEach(file => URL.revokeObjectURL(file.preview));
 }, [files]);

 function handleSubmit(){
 const url = files.map(file => (file.preview)).toString();
PostService
  .create(userData.username,title,url)
  .then(data => {
      //window.location = "/";
      console.log(data);

  }).catch(err => {
      console.log(err.message);
  });

 }
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda