Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:44:01+00:00 2026-06-05T22:44:01+00:00

I need to build some client side code which follows this use case: An

  • 0

I need to build some client side code which follows this use case:

  1. An image is uploaded via ftp with a name like “1.jpeg” or “1.png” (the “1” is based on the id set in the database)
  2. I need to inject an img onto the page with a src attribtue of “1.jpeg” or “1.png” (depending on which file actually exists)

My current idea is to create another spot into phpMyAdmin to dictate file type, however I’d like to avoid that (because it depends on non-programmers/designers correctly identifying filetypes). Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:44:03+00:00Added an answer on June 5, 2026 at 10:44 pm

    If the client gets no more information than the id, then you’ve only got three options as far as I see:

    1. Have the client try each of the possible URLs, ignoring 404s until you hit a 200 response and then use that (pretty nasty solution).
    2. Write a server side handler that allows you to pass the id back and have it do the file existence checks and stream back the file. So you’d end up with something like <img src='/getimage?id=1' /> (much nicer solution, but isn’t pure javascript which you imply is what you want).
    3. Pass more info back to the client in the first place (like the filetype solution you suggest, although you could probably determine it off the file rather than adding another field if you have control over the upload)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think in this case I need to write a client side script that
I need to build some JSON out from PHP. The structure of the JSON
I need to build a class that will represent a row in some table
I need to build an url like this: /products/myproductdescription/5; it works except when the
I have a specific case here in which I would like some security advice.
I need to build Android application using Java which is able to send request
I need to build a client application that connects to the team foundation server
I have to build an vsftpd compatible ftp client. I am not sure about
I'm working on a client-side Java application for which I want to create a
Perviously the client uploaded same app on iTunes connect and rejected for some reason.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.