Re: File upload woes

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 19162
interpreted = N
texte = Jose wrote:>After lurking on the digest for a few months I'm back with a tough >question. Is anyone using a Web based file upload solution with >WebCatalog successfully? When I started working on this site I expected >to be able to use SiteEdit Pro to handle the file uploading portion of >this project. However, after trying out different things and searching >the archives it became apparent that SiteEdit Pro would not allow me to >customize the page that it returns after uploading a file. Thus I >resorted to the Web* file upload plugin, since it returns the >default.html page after an upload, which I can generate dynamically from >my upload template itself. I was doing some experimenting with a similiar situation a few weeks back. For use with WebCat and WebSTAR I like Upload:http://www.netdreams.com/net.dreams/5th/upload/index.shtmlWith Upload you can show any page you want and pass all the form variables using the tag in the User Configuration File. I have WebCat automatically create it, and the user's folder when the account is created. >That worked fine, however I've stumbled on >another problem now. We are trying to generate little simple on-line >stores through a web based interface. I've reused some code from the >Database Helper included with WebCatalog, and I'm trying to enable the >user who is adding database records through the New Database interface >to browse his hard drive and upload the images and have that image name >included in the record he is creating automatically. Rather than use the user's own image file name, I have WebCat rename the uploaded image file to [sku].jpg in the user's directory as soon as the upload is complete. As well as organizing things nicely for working with WebDNA, this insures that any file uploaded to your server will always have the suffix .jpg (good for security). I do not think it makes any difference to a browser if a GIF is served as 123456.jpg or 123456.gif, but I'm sure someone else on the list knows more about that than I do.>I know this is >probably a stretch, but our customer was really unhappy with how kludgy >the current solution is(add your image names when generating the records >and then later on upload the images separately). The work we have so >far, is located at: >http://www.iwcc.com/cybermiami/cartgenerator/This is basically the way I did it:1. User fills in the product form, then selects the local image file associated with it.2. Upload moves a copy to the server.3. The image file is renamed by WebCat to [sku].jpg in the user's directory.4. Since the form variables can be forwarded to the specified URL, a WebCat generated page is returned to the user showing the picture (downloaded back from the server to the user's browser) along with the text/description that the user entered in the record creation form. I have a delete link on that page in case the user picked the wrong image file to go with the product etc.. When the user deletes the record, the image file is also deleted from the server by WebCat.>Only the Type 1 Shopping cart is working so far(so select that), and the >problem I'm talking about refers to the Option #2 Create New Database. >Everyone on the list is welcome to stop by and check it out. Any ideas, >or thoughts would be greatly welcomed, and If all else fails I can >always resort to PHP3 on our Alpha/Linux server to handle this portion >of the work, and upload it to the WebCat server via netatalk, but I >really hope to avoid this and be able to do everything from within >WebCatalog. Again any help, ideas and criticism will be greatly appreciated.From my experimenting, I would say there is no need for you to have your Alpha/Linux server handle the task -- it would complicate things even more. I have not done much testing, but using a Windows machine at home, modem connection, and a couple of Navigator versions I was able to easily upload image files to the server, process it with WebCat, then return the image back to the browser -- just by selecting the local file in the browser and pushing the button. All the user sees are WebCat generated pages.From taking a quick look at your pages, I should mention that the method I outlined above makes use of WebCat's user/pass features so that only authorized users can add or delete products and images, and only to their own records. The product records for all the vendors are stored in one db. There is one record for each vendor in another db. When a product record is created, a user id number (doing a lookup using [password] in the vendor db) is added. This way whenever I want to later display the image it is simply /[user_id]/[sku].jpg (ie. /images/554/989855.jpg)If I were you, I would not show the sku in the record creation form, instead do it as a hidden value. For some ideas on how to do some of the sku, lookups, and image display WebDNA -- Ken did some great examples in the classified templates of Typhoon.I hope that makes some sense to somebody else but me... I'm up late and I don't have those templates here :)Wendell > >Thanks, >Jose >-- >----------------------------------------------------- > > The International Website Construction Co. > http://www.iwcc.com/ > >Miami --- Sao Paulo --- Buenos Aires --- Lima > > Web Advertising and Design for the > Latin American Market > > voice: (305) 666-1012 > 3714 Matheson Ave. > Coconut Grove, FL > 33133, USA >----------------------------------------------------- > Associated Messages, from the most recent to the oldest:

    
  1. Re: File upload woes (Wendell B. Kozak 1998)
  2. Re: File upload woes (Kenneth Grome 1998)
  3. Re: File upload woes (Jose A. Gordo 1998)
  4. Re: File upload woes (Wendell B. Kozak 1998)
  5. File upload woes (Jose A. Gordo 1998)
Jose wrote:>After lurking on the digest for a few months I'm back with a tough >question. Is anyone using a Web based file upload solution with >WebCatalog successfully? When I started working on this site I expected >to be able to use SiteEdit Pro to handle the file uploading portion of >this project. However, after trying out different things and searching >the archives it became apparent that SiteEdit Pro would not allow me to >customize the page that it returns after uploading a file. Thus I >resorted to the Web* file upload plugin, since it returns the >default.html page after an upload, which I can generate dynamically from >my upload template itself. I was doing some experimenting with a similiar situation a few weeks back. For use with WebCat and WebSTAR I like Upload:http://www.netdreams.com/net.dreams/5th/upload/index.shtmlWith Upload you can show any page you want and pass all the form variables using the tag in the User Configuration File. I have WebCat automatically create it, and the user's folder when the account is created. >That worked fine, however I've stumbled on >another problem now. We are trying to generate little simple on-line >stores through a web based interface. I've reused some code from the >Database Helper included with WebCatalog, and I'm trying to enable the >user who is adding database records through the New Database interface >to browse his hard drive and upload the images and have that image name >included in the record he is creating automatically. Rather than use the user's own image file name, I have WebCat rename the uploaded image file to [sku].jpg in the user's directory as soon as the upload is complete. As well as organizing things nicely for working with WebDNA, this insures that any file uploaded to your server will always have the suffix .jpg (good for security). I do not think it makes any difference to a browser if a GIF is served as 123456.jpg or 123456.gif, but I'm sure someone else on the list knows more about that than I do.>I know this is >probably a stretch, but our customer was really unhappy with how kludgy >the current solution is(add your image names when generating the records >and then later on upload the images separately). The work we have so >far, is located at: >http://www.iwcc.com/cybermiami/cartgenerator/This is basically the way I did it:1. User fills in the product form, then selects the local image file associated with it.2. Upload moves a copy to the server.3. The image file is renamed by WebCat to [sku].jpg in the user's directory.4. Since the form variables can be forwarded to the specified URL, a WebCat generated page is returned to the user showing the picture (downloaded back from the server to the user's browser) along with the text/description that the user entered in the record creation form. I have a delete link on that page in case the user picked the wrong image file to go with the product etc.. When the user deletes the record, the image file is also deleted from the server by WebCat.>Only the Type 1 Shopping cart is working so far(so select that), and the >problem I'm talking about refers to the Option #2 Create New Database. >Everyone on the list is welcome to stop by and check it out. Any ideas, >or thoughts would be greatly welcomed, and If all else fails I can >always resort to PHP3 on our Alpha/Linux server to handle this portion >of the work, and upload it to the WebCat server via netatalk, but I >really hope to avoid this and be able to do everything from within >WebCatalog. Again any help, ideas and criticism will be greatly appreciated.From my experimenting, I would say there is no need for you to have your Alpha/Linux server handle the task -- it would complicate things even more. I have not done much testing, but using a Windows machine at home, modem connection, and a couple of Navigator versions I was able to easily upload image files to the server, process it with WebCat, then return the image back to the browser -- just by selecting the local file in the browser and pushing the button. All the user sees are WebCat generated pages.From taking a quick look at your pages, I should mention that the method I outlined above makes use of WebCat's user/pass features so that only authorized users can add or delete products and images, and only to their own records. The product records for all the vendors are stored in one db. There is one record for each vendor in another db. When a product record is created, a user id number (doing a lookup using [password] in the vendor db) is added. This way whenever I want to later display the image it is simply /[user_id]/[sku].jpg (ie. /images/554/989855.jpg)If I were you, I would not show the sku in the record creation form, instead do it as a hidden value. For some ideas on how to do some of the sku, lookups, and image display WebDNA -- Ken did some great examples in the classified templates of Typhoon.I hope that makes some sense to somebody else but me... I'm up late and I don't have those templates here :)Wendell > >Thanks, >Jose >-- >----------------------------------------------------- > > The International Website Construction Co. > http://www.iwcc.com/ > >Miami --- Sao Paulo --- Buenos Aires --- Lima > > Web Advertising and Design for the > Latin American Market > > voice: (305) 666-1012 > 3714 Matheson Ave. > Coconut Grove, FL > 33133, USA >----------------------------------------------------- > Wendell B. Kozak

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Empty Shopping Carts? (1998) The max=0 issue is a bug ... CALL TO ACTION (2000) Graphs & diagrams (2003) [taxRate] [TaxTotal] ? (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) carriage returns in data (1997) WARNING: MacOS The installer is broken... (2000) Not really WebCat (1997) replace urgent!!!! (2001) Bug Report, maybe (1997) WebCat for Site Search? (1997) room needed to share at Moscone Marriott (1999) Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (2003) Country & Ship-to address & other fields ? (1997) Date format problems (1997) Add to a field (1998) founditems (1998) Show if time tags (1997) Help! WebMerchant store suddenly won't process orders... (2001) $Quit, $CloseDatabase corrections (1997)