Topic: Uploading images w/ uploaded CSV info (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29287" title="Pages that link to Topic: Uploading images w/ uploaded CSV info (Page 1 of 1)" rel="nofollow" >Topic: Uploading images w/ uploaded CSV info <span class="small">(Page 1 of 1)</span>\

 
redroy
Paranoid (IV) Inmate

From: 1393
Insane since: Dec 2003

posted posted 06-19-2007 03:16

Hey,

I've got a function that I'm writing that uploads a CSV file and populates the DB with some of the CSV info; I've got that all working just fine. The problem I've run into is I would like to upload additional files (images) depending upon the location set within the CSV file. Is there a way to tell PHP to look on the users machine for the path given? So what I have is...

1. CSV is uploaded
2. DB is updated with info, including local path (according to the users network)
3. PHP tries to upload the images according to the path given but it's not working, I'm assuming this is because it is looking for the image files on the server.

I've tested the upload functionality in all other cases and it works perfectly. Is this something that can't be done?

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-19-2007 09:21

This is not possible for obvious security reasons. Imagine if any website could fetch a file on end users' machine

The only solution would be to have a webserver running on the users' network and exposing the path containing the images. But I guess the location are pretty random and the server should work only for images and require an HTTP AUTH. But even there's a big privacy concern.

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-19-2007 09:25

You'd rather have the users upload a ZIP with the files they need, or do that in 2 passes: first the upload of the CSV, then a FORM with as many FILE upload as required and an em informing the user of the local path you saw in the CSV file.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-19-2007 09:56

poi is right.

Now if you really really need to do this... a custom signed java applet with security privileges to access the local machine, parsing parts of the csv on the local machine, and doing a load of file uploads from that is they way... but that's a lot of trouble.

redroy
Paranoid (IV) Inmate

From: 1393
Insane since: Dec 2003

posted posted 06-20-2007 00:55

Thanks for the info... I like poi's idea of having it a "two-step" process.

Nathus
Bipolar (III) Inmate

From: Minnesota
Insane since: Aug 2003

posted posted 06-20-2007 00:57

just be careful of too many file uploads at a time

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-20-2007 09:00

yes, php has a 2 mbyte upload limit by default.

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-20-2007 09:05

This is where/when I'm looking forward for low level network API and file API ( prompting the user to grant any kind of action the first time it's attempted ) in JS. This would be a major kick for web Apps. and widgets.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu